Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 75d9630d
由
LN
编写于
2023-04-18 12:21:08 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
hotayi登陆验证修改
1 个父辈
028bebd0
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
48 行增加
和
13 行删除
src/main/java/com/neotel/smfcore/custom/hotayi20057/HotayiApi.java
src/main/resources/messages.properties
src/main/resources/messages_en_US.properties
src/main/resources/messages_ja_JP.properties
src/main/resources/messages_zh_CN.properties
src/main/resources/messages_zh_TW.properties
src/main/java/com/neotel/smfcore/custom/hotayi20057/HotayiApi.java
查看文件 @
75d9630
...
@@ -137,8 +137,10 @@ public class HotayiApi extends BaseSmfApiListener {
...
@@ -137,8 +137,10 @@ public class HotayiApi extends BaseSmfApiListener {
CodeBean
codeBean
=
BarcodeRule
.
splitCodeAndSize
(
params
.
getCode
());
CodeBean
codeBean
=
BarcodeRule
.
splitCodeAndSize
(
params
.
getCode
());
String
reelId
=
codeBean
.
getCodeStr
();
String
reelId
=
codeBean
.
getCodeStr
();
HotayiBean
m6Bean
=
getM6Bean
(
reelId
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"Barcode"
,
reelId
);
paramMap
.
put
(
"Info"
,
m6Bean
.
getInfo
());
paramMap
.
put
(
"Data"
,
m6Bean
.
getData
());
log
.
info
(
reelId
+
"入库验证M6,参数"
+
JsonUtil
.
toJsonStr
(
paramMap
));
log
.
info
(
reelId
+
"入库验证M6,参数"
+
JsonUtil
.
toJsonStr
(
paramMap
));
String
result
=
HttpHelper
.
getJson
(
codeResolveUrl
,
paramMap
);
String
result
=
HttpHelper
.
getJson
(
codeResolveUrl
,
paramMap
);
...
@@ -191,7 +193,7 @@ public class HotayiApi extends BaseSmfApiListener {
...
@@ -191,7 +193,7 @@ public class HotayiApi extends BaseSmfApiListener {
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"入库验证接口出错:"
+
e
.
getMessage
());
log
.
error
(
"入库验证接口出错:"
+
e
.
getMessage
());
throw
new
ValidateException
(
"smfcore.mesApi.inCheck.error"
,
"MES验证出错:"
+
e
.
getMessage
());
throw
new
ValidateException
(
"smfcore.mesApi.inCheck.error"
,
"MES验证出错:"
+
e
.
getMessage
()
,
new
String
[]{
e
.
getMessage
()}
);
}
}
}
}
...
@@ -276,6 +278,15 @@ public class HotayiApi extends BaseSmfApiListener {
...
@@ -276,6 +278,15 @@ public class HotayiApi extends BaseSmfApiListener {
//“Mode”: “1”
//“Mode”: “1”
// }
// }
// }
// }
private
HotayiBean
getM6Bean
(
String
barcode
)
{
HotayiBean
bean
=
new
HotayiBean
();
bean
.
addInfo
(
"MachineID"
,
machineID
);
bean
.
addInfo
(
"IPAddress"
,
iPAddress
);
bean
.
addInfo
(
"MessageNo"
,
"M6"
);
bean
.
addData
(
"Barcode"
,
barcode
);
return
bean
;
}
private
HotayiBean
getM10Bean
(
String
barcode
,
Integer
OperationMode
,
Integer
Mode
)
{
private
HotayiBean
getM10Bean
(
String
barcode
,
Integer
OperationMode
,
Integer
Mode
)
{
HotayiBean
bean
=
new
HotayiBean
();
HotayiBean
bean
=
new
HotayiBean
();
bean
.
addInfo
(
"MachineID"
,
machineID
);
bean
.
addInfo
(
"MachineID"
,
machineID
);
...
@@ -303,7 +314,7 @@ public class HotayiApi extends BaseSmfApiListener {
...
@@ -303,7 +314,7 @@ public class HotayiApi extends BaseSmfApiListener {
HotayiBean
m22Bean
=
getM22Bean
(
userName
,
pwd
,
"SMT Machine"
);
HotayiBean
m22Bean
=
getM22Bean
(
userName
,
pwd
,
"SMT Machine"
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"Info"
,
m22Bean
.
getInfo
());
paramMap
.
put
(
"Info"
,
m22Bean
.
getInfo
());
paramMap
.
put
(
"Dat
e
"
,
m22Bean
.
getData
());
paramMap
.
put
(
"Dat
a
"
,
m22Bean
.
getData
());
String
requestParams
=
JsonUtil
.
toJsonStr
(
paramMap
);
String
requestParams
=
JsonUtil
.
toJsonStr
(
paramMap
);
...
@@ -315,14 +326,18 @@ public class HotayiApi extends BaseSmfApiListener {
...
@@ -315,14 +326,18 @@ public class HotayiApi extends BaseSmfApiListener {
result
=
result
.
replace
(
"\"{"
,
"{"
);
result
=
result
.
replace
(
"\"{"
,
"{"
);
result
=
result
.
replace
(
"}\""
,
"}"
);
result
=
result
.
replace
(
"}\""
,
"}"
);
log
.
info
(
userName
+
"登陆验证M22 处理后"
+
result
);
log
.
info
(
userName
+
"登陆验证M22 处理后"
+
result
);
// 2023-04-18 11:16:04.447 INFO [HotayiApi.java:323] - 47024登陆验证M22 返回"{\"Info\":{\"MachineID\":1441,\"IPAddress\":\"10.1.41.93\",\"MessageNo\":\"m21\"},\"Data\":{\"Username\":\"YEONG CHEN YIE\",\"UserLevel\":10}}"
// 2023-04-18 11:16:04.447 INFO [HotayiApi.java:328] - 47024登陆验证M22 处理后
// {"Info":{"MachineID":1441,"IPAddress":"10.1.41.93","MessageNo":"m21"},"Data":{"Username":"YEONG CHEN YIE","UserLevel":10}}
HotayiBean
hotayiBean
=
JsonUtil
.
toObj
(
result
,
HotayiBean
.
class
);
HotayiBean
hotayiBean
=
JsonUtil
.
toObj
(
result
,
HotayiBean
.
class
);
String
resultMsgNo
=
hotayiBean
.
getInfoItem
(
"MessageNo"
);
String
resultMsgNo
=
hotayiBean
.
getInfoItem
(
"MessageNo"
);
if
(
resultMsgNo
.
equals
(
"M90"
))
{
if
(
resultMsgNo
.
equals
(
"M90"
))
{
String
errorCode
=
hotayiBean
.
getDataItem
(
"ErrorCode"
);
String
errorCode
=
hotayiBean
.
getDataItem
(
"ErrorCode"
);
String
errorMessage
=
hotayiBean
.
getDataItem
(
"ErrorMessage"
);
String
errorMessage
=
hotayiBean
.
getDataItem
(
"ErrorMessage"
);
throw
new
ValidateException
(
"smfcore.mesApi.loginCheck.
ng"
,
"NG: ["
+
errorCode
+
"]"
+
errorMessage
);
throw
new
ValidateException
(
"smfcore.mesApi.loginCheck.
error"
,
"NG: ["
+
errorCode
+
"]"
+
errorMessage
,
new
String
[]{
"["
+
errorCode
+
"]"
+
errorMessage
}
);
}
else
{
}
else
{
String
UserLevel
=
hotayiBean
.
getInfoItem
(
"UserLevel"
);
Integer
UserLevel
=
hotayiBean
.
getDataItem
(
"UserLevel"
);
// String name=hotayiBean.getDataItem("Username");
if
(
ObjectUtil
.
isNotEmpty
(
UserLevel
))
{
if
(
ObjectUtil
.
isNotEmpty
(
UserLevel
))
{
log
.
info
(
userName
+
"登陆验证M22 返回 UserLevel="
+
UserLevel
);
log
.
info
(
userName
+
"登陆验证M22 返回 UserLevel="
+
UserLevel
);
...
@@ -339,10 +354,10 @@ public class HotayiApi extends BaseSmfApiListener {
...
@@ -339,10 +354,10 @@ public class HotayiApi extends BaseSmfApiListener {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"登陆验证接口出错:"
+
e
.
getMessage
());
log
.
error
(
"登陆验证接口出错:"
+
e
.
getMessage
());
throw
new
ValidateException
(
"smfcore.mesApi.loginCheck.error"
,
"MES Login Error:"
+
e
.
getMessage
());
throw
new
ValidateException
(
"smfcore.mesApi.loginCheck.error"
,
"MES Login Error:"
+
e
.
getMessage
()
,
new
String
[]{
e
.
getMessage
()}
);
}
}
}
}
private
void
autoCreateUser
(
String
userName
,
String
pwd
,
String
userLevel
)
{
private
void
autoCreateUser
(
String
userName
,
String
pwd
,
Integer
userLevel
)
{
try
{
try
{
// 10 = Administrator
// 10 = Administrator
// 20 = Engineer
// 20 = Engineer
...
@@ -353,9 +368,9 @@ public class HotayiApi extends BaseSmfApiListener {
...
@@ -353,9 +368,9 @@ public class HotayiApi extends BaseSmfApiListener {
log
.
info
(
"autoCreateUser 未找到用户,自动创建用户["
+
userName
+
"] "
);
log
.
info
(
"autoCreateUser 未找到用户,自动创建用户["
+
userName
+
"] "
);
String
roleName
=
"operater"
;
String
roleName
=
"operater"
;
if
(
userLevel
.
equals
(
"10"
)
)
{
if
(
userLevel
==
10
)
{
roleName
=
"admin"
;
roleName
=
"admin"
;
}
else
if
(
userLevel
.
equals
(
"20"
)
)
{
}
else
if
(
userLevel
==
20
)
{
roleName
=
"engineer"
;
roleName
=
"engineer"
;
}
}
...
@@ -376,6 +391,11 @@ public class HotayiApi extends BaseSmfApiListener {
...
@@ -376,6 +391,11 @@ public class HotayiApi extends BaseSmfApiListener {
user
.
setLanguage
(
"en_US"
);
user
.
setLanguage
(
"en_US"
);
user
.
setRoleId
(
role
.
getId
());
user
.
setRoleId
(
role
.
getId
());
user
.
setEnabled
(
true
);
user
.
setEnabled
(
true
);
if
(
userLevel
==
10
){
user
.
setIsAdmin
(
true
);
}
else
{
user
.
setIsAdmin
(
false
);
}
user
=
userManager
.
save
(
user
);
user
=
userManager
.
save
(
user
);
log
.
info
(
"autoCreateUser 未找到用户,自动创建用户["
+
userName
+
"]完成 "
);
log
.
info
(
"autoCreateUser 未找到用户,自动创建用户["
+
userName
+
"]完成 "
);
...
...
src/main/resources/messages.properties
查看文件 @
75d9630
...
@@ -346,6 +346,9 @@ smfcore.queryPos.solderOutFail=[{0}]checkOut fail,currStatus[{1}]
...
@@ -346,6 +346,9 @@ smfcore.queryPos.solderOutFail=[{0}]checkOut fail,currStatus[{1}]
smfcore.operationFailure
=
\u
64CD
\u
4F5C
\u5931\u
8D25
smfcore.operationFailure
=
\u
64CD
\u
4F5C
\u5931\u
8D25
smfcore.hotayi.machineID.error
=
machineID inconsistency [{0}] [{1}]
smfcore.hotayi.machineID.error
=
machineID inconsistency [{0}] [{1}]
smfcore.selfAudit.noPos
=
\u
76D8
\u
70B9{0}
\u
672A
\u
627E
\u5230\u
5E93
\u
4F4D
\u
53F7
smfcore.selfAudit.noPos
=
\u
76D8
\u
70B9{0}
\u
672A
\u
627E
\u5230\u
5E93
\u
4F4D
\u
53F7
smfcore.mesApi.inCheck.error
=
MES
\u
9A8C
\u
8BC1
\u
51FA
\u9519\u
FF1A{0}
smfcore.mesApi.loginCheck.fail
=
MES
\u
767B
\u9646\u
9A8C
\u
8BC1
\u5931\u
8D25
smfcore.mesApi.loginCheck.error
=
MES
\u
767B
\u9646\u
9A8C
\u
8BC1
\u9519\u
8BEF
\u
FF1A{0}
#smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0}
#smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0}
#smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1}
#smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1}
#smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F
#smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F
...
...
src/main/resources/messages_en_US.properties
查看文件 @
75d9630
...
@@ -344,4 +344,7 @@ order.error.executing= {0} Already in the task list
...
@@ -344,4 +344,7 @@ order.error.executing= {0} Already in the task list
smfcore.queryPos.solderOutFail
=
[{0}]checkOut fail,currStatus[{1}]
smfcore.queryPos.solderOutFail
=
[{0}]checkOut fail,currStatus[{1}]
smfcore.operationFailure
=
Operation failed
smfcore.operationFailure
=
Operation failed
smfcore.hotayi.machineID.error
=
machineID inconsistency [{0}] [{1}]
smfcore.hotayi.machineID.error
=
machineID inconsistency [{0}] [{1}]
smfcore.selfAudit.noPos
=
Self Audit{0}No depot number found
\ No newline at end of file
\ No newline at end of file
smfcore.selfAudit.noPos
=
Self Audit{0}No depot number found
smfcore.mesApi.inCheck.error
=
MES verification error
\u
FF1A{0}
smfcore.mesApi.loginCheck.fail
=
MES Login fail
smfcore.mesApi.loginCheck.error
=
MES Login error
\u
FF1A{0}
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_ja_JP.properties
查看文件 @
75d9630
...
@@ -341,4 +341,7 @@ order.error.executing={0}\u5DF2\u5728\u4EFB\u52A1\u5217\u8868\u4E2D
...
@@ -341,4 +341,7 @@ order.error.executing={0}\u5DF2\u5728\u4EFB\u52A1\u5217\u8868\u4E2D
smfcore.queryPos.solderOutFail
=
[{0}]checkOut fail,currStatus[{1}]
smfcore.queryPos.solderOutFail
=
[{0}]checkOut fail,currStatus[{1}]
smfcore.operationFailure
=
\u
64CD
\u
4F5C
\u5931\u
8D25
smfcore.operationFailure
=
\u
64CD
\u
4F5C
\u5931\u
8D25
smfcore.hotayi.machineID.error
=
machineID inconsistency [{0}] [{1}]
smfcore.hotayi.machineID.error
=
machineID inconsistency [{0}] [{1}]
smfcore.selfAudit.noPos
=
\u
76D8
\u
70B9{0}
\u
672A
\u
627E
\u5230\u
5E93
\u
4F4D
\u
53F7
\ No newline at end of file
\ No newline at end of file
smfcore.selfAudit.noPos
=
\u
76D8
\u
70B9{0}
\u
672A
\u
627E
\u5230\u
5E93
\u
4F4D
\u
53F7
smfcore.mesApi.inCheck.error
=
MES
\u
9A8C
\u
8BC1
\u
51FA
\u9519\u
FF1A{0}
smfcore.mesApi.loginCheck.fail
=
MES
\u
767B
\u9646\u
9A8C
\u
8BC1
\u5931\u
8D25
smfcore.mesApi.loginCheck.error
=
MES
\u
767B
\u9646\u
9A8C
\u
8BC1
\u9519\u
8BEF
\u
FF1A{0}
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_zh_CN.properties
查看文件 @
75d9630
...
@@ -341,4 +341,7 @@ order.error.executing={0}\u5DF2\u5728\u4EFB\u52A1\u5217\u8868\u4E2D
...
@@ -341,4 +341,7 @@ order.error.executing={0}\u5DF2\u5728\u4EFB\u52A1\u5217\u8868\u4E2D
smfcore.queryPos.solderOutFail
=
[{0}]
\u
51FA
\u
5E93
\u5931\u
8D25
\u
FF0C
\u
5F53
\u
524D
\u
72B6
\u6001\u
FF1A[{1}]
smfcore.queryPos.solderOutFail
=
[{0}]
\u
51FA
\u
5E93
\u5931\u
8D25
\u
FF0C
\u
5F53
\u
524D
\u
72B6
\u6001\u
FF1A[{1}]
smfcore.operationFailure
=
\u
64CD
\u
4F5C
\u5931\u
8D25
smfcore.operationFailure
=
\u
64CD
\u
4F5C
\u5931\u
8D25
smfcore.hotayi.machineID.error
=
machineID inconsistency [{0}] [{1}]
smfcore.hotayi.machineID.error
=
machineID inconsistency [{0}] [{1}]
smfcore.selfAudit.noPos
=
\u
76D8
\u
70B9{0}
\u
672A
\u
627E
\u5230\u
5E93
\u
4F4D
\u
53F7
\ No newline at end of file
\ No newline at end of file
smfcore.selfAudit.noPos
=
\u
76D8
\u
70B9{0}
\u
672A
\u
627E
\u5230\u
5E93
\u
4F4D
\u
53F7
smfcore.mesApi.inCheck.error
=
MES
\u
9A8C
\u
8BC1
\u
51FA
\u9519\u
FF1A{0}
smfcore.mesApi.loginCheck.fail
=
MES
\u
767B
\u9646\u
9A8C
\u
8BC1
\u5931\u
8D25
smfcore.mesApi.loginCheck.error
=
MES
\u
767B
\u9646\u
9A8C
\u
8BC1
\u9519\u
8BEF
\u
FF1A{0}
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_zh_TW.properties
查看文件 @
75d9630
...
@@ -342,4 +342,7 @@ order.error.executing={0}\u5DF2\u5728\u4EFB\u52D9\u5217\u8868\u4E2D
...
@@ -342,4 +342,7 @@ order.error.executing={0}\u5DF2\u5728\u4EFB\u52D9\u5217\u8868\u4E2D
smfcore.queryPos.solderOutFail
=
[{0}]
\u
51FA
\u
5E93
\u5931\u
8D25
\u
FF0C
\u
5F53
\u
524D
\u
72B6
\u6001\u
FF1A[{1}]
smfcore.queryPos.solderOutFail
=
[{0}]
\u
51FA
\u
5E93
\u5931\u
8D25
\u
FF0C
\u
5F53
\u
524D
\u
72B6
\u6001\u
FF1A[{1}]
smfcore.operationFailure
=
\u
64CD
\u
4F5C
\u5931\u
8D25
smfcore.operationFailure
=
\u
64CD
\u
4F5C
\u5931\u
8D25
smfcore.hotayi.machineID.error
=
machineID inconsistency [{0}] [{1}]
smfcore.hotayi.machineID.error
=
machineID inconsistency [{0}] [{1}]
smfcore.selfAudit.noPos
=
\u
76E4
\u
9EDE{0}
\u
672A
\u
627E
\u5230\u
5EAB
\u
4F4D
\u
865F
\ No newline at end of file
\ No newline at end of file
smfcore.selfAudit.noPos
=
\u
76E4
\u
9EDE{0}
\u
672A
\u
627E
\u5230\u
5EAB
\u
4F4D
\u
865F
smfcore.mesApi.inCheck.error
=
MES
\u
9A57
\u
8B49
\u
51FA
\u
932F
\u
FF1A{0}
smfcore.mesApi.loginCheck.fail
=
MES
\u
767B
\u9678\u
9A57
\u
8B49
\u5931\u6557
smfcore.mesApi.loginCheck.error
=
MES
\u
767B
\u9678\u
9A57
\u
8B49
\u
932F
\u
8AA4
\u
FF1A{0}
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论