Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 48206af9
由
LN
编写于
2023-04-13 14:07:01 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
hotayi接口修改。
地址改为:F1_EstablishConnection/F2_GetMachineStatus/F4_StockOut
1 个父辈
c06c7945
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
92 行增加
和
74 行删除
src/main/java/com/neotel/smfcore/custom/hotayi20057/HotayiApi.java
src/main/java/com/neotel/smfcore/custom/hotayi20057/HotayiController.java
src/main/java/com/neotel/smfcore/security/rest/AuthorizationController.java
src/main/java/com/neotel/smfcore/security/service/UserDetailsServiceImpl.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
查看文件 @
48206af
...
...
@@ -59,6 +59,17 @@ public class HotayiApi extends BaseSmfApiListener {
return
apiName
!=
null
&&
apiName
.
equalsIgnoreCase
(
"20057"
);
}
// api:
// name: 20057
// codeResolveUrl: http://srvpcs-1:8383/SolderPasteStorageSvc/F3_StockIn
// inNotifyUrl: http://srvpcs-1:8383/SolderPasteStorageSvc/F5_Notification
// outNotifyUrl: http://srvpcs-1:8383/SolderPasteStorageSvc/F5_Notification
// loginCheckUrl: http://srvpcs-1:8383/SolderPasteStorageSvc/F11_LoginAuthentication
// hotayi:
// MachineID:
// IPAddress:
// api:
// name: "20057"
// codeResolveUrl: "http://203.106.167.221:8383/SolderPasteStorageSvc/F3_StockIn"
...
...
src/main/java/com/neotel/smfcore/custom/hotayi20057/HotayiController.java
查看文件 @
48206af
...
...
@@ -2,8 +2,11 @@ package com.neotel.smfcore.custom.hotayi20057;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.common.utils.JsonUtil
;
import
com.neotel.smfcore.core.barcode.enums.SOLDER_STATUS
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.order.LiteOrderCache
;
...
...
@@ -48,6 +51,9 @@ public class HotayiController {
@Autowired
private
TaskService
taskService
;
@Autowired
private
IBarcodeManager
barcodeManager
;
/**
* 收到M1返回M2
* M2 Machine Information
...
...
@@ -77,7 +83,7 @@ public class HotayiController {
* “SpecID”: 100 }
* }
*/
@RequestMapping
(
"/
m1
"
)
@RequestMapping
(
"/
F1_EstablishConnection
"
)
@AnonymousAccess
public
HotayiBean
m1
(
@RequestBody
HotayiBean
hotayiBean
)
{
log
.
info
(
"收到M1请求数据为:{}"
,
JsonUtil
.
toJsonStr
(
hotayiBean
));
...
...
@@ -120,7 +126,7 @@ public class HotayiController {
* @param hotayiBean
* @return
*/
@RequestMapping
(
"/
m3
"
)
@RequestMapping
(
"/
F2_GetMachineStatus
"
)
@AnonymousAccess
public
HotayiBean
m3
(
@RequestBody
HotayiBean
hotayiBean
)
{
log
.
info
(
"收到M3请求数据为:{}"
,
JsonUtil
.
toJsonStr
(
hotayiBean
));
...
...
@@ -150,87 +156,55 @@ public class HotayiController {
}
// Stock Out
// Message send by MES to request machine operation
// Direction: MES → Machine
// Fields Type Range Optional Description
// Barcode String Any No Solder Paste
// Barcode
// Request Date Datetime Any No Start Process
// Output Date
// (Include Cycle
//Time & Standby
// Hour etc.)
// Format: yyyymm-dd hh:mm
// MixerBySecond Int 1 ~ n No Mixer Time
// Standby Hour Int 1 ~ n No Standby Time
// Sample:
// {
// “Info”: {
//“MachineID”: “00001”,
//“IPAddress”: “192.168.0.1”,
//“MessageNo”: “M5”
// },
//“Data”: {
// “Barcode”: “A005$$A”,
//“RequestDate”: “2022-01-01 19:00”,
//“MixerBySecond”: 120,
//“StandbyHour”: 4
// }
// }
@RequestMapping
(
"/m7"
)
@RequestMapping
(
"/F4_StockOut"
)
@AnonymousAccess
public
HotayiBean
m7
(
@RequestBody
HotayiBean
hotayiBean
)
{
log
.
info
(
"收到M7请求数据为:{0}"
,
JsonUtil
.
toJsonStr
(
hotayiBean
));
String
barcode
=
hotayiBean
.
getInfoItem
(
"Barcode"
);
String
RequestDate
=
hotayiBean
.
getInfoItem
(
"RequestDate"
);
String
MixerBySecond
=
hotayiBean
.
getInfoItem
(
"MixerBySecond"
);
String
StandbyHour
=
hotayiBean
.
getInfoItem
(
"StandbyHour"
);
log
.
info
(
"收到M7请求数据为: "
+
JsonUtil
.
toJsonStr
(
hotayiBean
));
// { "Info": {"MachineID": "0001","IPAddress": "192.168.0.1","MessageNo": "M7"},
// "Data": {"Barcode": "A069-O9","RequestDate": "2023-04-12 17:20","MixerBySecond": "0","StandbyHour": 0}}
String
barcode
=
hotayiBean
.
getDataItem
(
"Barcode"
);
String
RequestDate
=
hotayiBean
.
getDataItem
(
"RequestDate"
);
String
MixerBySecond
=
hotayiBean
.
getDataItem
(
"MixerBySecond"
);
Integer
StandbyHour
=
hotayiBean
.
getDataItem
(
"StandbyHour"
);
Date
outDate
=
DateUtil
.
toDate
(
RequestDate
,
"yyyy-MM-dd HH:mm"
);
if
(
outDate
==
null
){
log
.
info
(
"M7: requestDate==null 重置为当前时间"
);
outDate
=
new
Date
();
}
Locale
locale
=
new
Locale
(
"en"
,
"US"
);
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
barcode
);
if
(
pos
==
null
)
{
String
msg
=
MessageUtils
.
getText
(
"smfcore.queryPos.cannotFindBarcode"
,
locale
,
"cannot find barcode ["
+
barcode
+
"] In storage"
);
String
msg
=
MessageUtils
.
getText
(
"smfcore.queryPos.cannotFindBarcode"
,
new
String
[]{
barcode
},
locale
,
"cannot find barcode ["
+
barcode
+
"] In storage"
);
hotayiBean
.
setM90
(
71
,
msg
);
log
.
info
(
"M7返回M90,数据为:"
+
JsonUtil
.
toJsonStr
(
hotayiBean
));
return
hotayiBean
;
}
// //判断是否在出库中
// try
{
//
// } catch (ValidateException ex) {
// String msg = MessageUtils.getText(ex.getMsgKey(), locale, ex.getDefaultMsg()
);
// hotayiBean.setM90(72, msg
);
// log.info("M7返回M90,数据为:"+JsonUtil.toJsonStr(hotayiBean))
;
// return hotayiBean;
//
}
String
sStatus
=
pos
.
getBarcode
().
getSolderStatus
();
if
(
sStatus
.
equals
(
SOLDER_STATUS
.
RETREAT_STORAGE
.
name
())||
sStatus
.
equals
(
SOLDER_STATUS
.
UNDER_REFRIGERATION
.
name
())||
sStatus
.
equals
(
SOLDER_STATUS
.
NONE
.
name
())
)
{
}
else
{
String
msg
=
MessageUtils
.
getText
(
"smfcore.queryPos.solderOutFail"
,
new
String
[]{
barcode
,
sStatus
},
locale
,
" ["
+
barcode
+
"] checkOut fail,currStatus ["
+
sStatus
+
"]"
);
hotayiBean
.
setM90
(
72
,
msg
);
log
.
info
(
"M7返回M90,数据为:"
+
JsonUtil
.
toJsonStr
(
hotayiBean
)
);
return
hotayiBean
;
}
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
String
result
=
taskService
.
checkout
(
pos
,
true
,
null
,
false
);
if
(
ObjectUtil
.
isNotEmpty
(
result
))
{
String
msg
=
MessageUtils
.
getText
(
result
,
locale
,
"barcode ["
+
barcode
+
"] checkOut fail"
);
//需要定时出库
// String result = taskService.checkout(pos,true,null,false);
boolean
result
=
setOutDate
(
pos
,
outDate
);
if
(!
result
)
{
String
msg
=
MessageUtils
.
getText
(
"smfcore.operationFailure"
,
locale
,
"Operation failed"
);
hotayiBean
.
setM90
(
73
,
msg
);
log
.
info
(
"M7返回M90,数据为:"
+
JsonUtil
.
toJsonStr
(
hotayiBean
));
return
hotayiBean
;
}
// M8 Action Status
// Direction: MES Machine
// Fields Type Range Optional Description
// Message String String No Error Message
// Success Message
// Sample:
// {
// “Info”: {
//“MachineID”: “00001”,
//“IPAddress”: “192.168.0.1”,
//“MessageNo”: “M8”
// },
//“Data”: {
// “Message”: “Standby Success”
// }
// }
hotayiBean
.
addInfo
(
"MessageNo"
,
"M8"
);
Map
<
String
,
Object
>
resultData
=
new
HashMap
<>();
resultData
.
put
(
"Message"
,
"Standby Success"
);
...
...
@@ -239,6 +213,22 @@ public class HotayiController {
return
hotayiBean
;
}
private
boolean
setOutDate
(
StoragePos
pos
,
Date
outDate
)
{
Barcode
barcode
=
pos
.
getBarcode
();
if
(
barcode
!=
null
)
{
log
.
info
(
"设定仓位【"
+
pos
.
getPosName
()
+
"】中的锡膏["
+
barcode
.
getBarcode
()
+
"]出库时间:"
+
DateUtil
.
toDateTimeString
(
outDate
));
try
{
barcode
.
setSolderStatus
(
SOLDER_STATUS
.
TO_BE_REWARM
.
name
());
barcode
.
setNeedOutDate
(
outDate
);
barcodeManager
.
save
(
barcode
);
pos
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
pos
);
return
true
;
}
catch
(
ValidateException
e
)
{
log
.
error
(
"设定锡膏出库时间出错"
,
e
);
}
}
return
false
;
}
}
src/main/java/com/neotel/smfcore/security/rest/AuthorizationController.java
查看文件 @
48206af
...
...
@@ -16,6 +16,7 @@
package
com
.
neotel
.
smfcore
.
security
.
rest
;
import
com.neotel.smfcore.common.utils.*
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.security.annotation.AnonymousDeleteMapping
;
import
com.neotel.smfcore.security.annotation.AnonymousGetMapping
;
import
com.neotel.smfcore.security.annotation.AnonymousPostMapping
;
...
...
@@ -59,6 +60,7 @@ import java.util.Map;
public
class
AuthorizationController
{
private
final
SecurityProperties
properties
;
private
final
SmfApi
smfApi
;
@Autowired
private
OnlineUserService
onlineUserService
;
...
...
@@ -83,6 +85,8 @@ public class AuthorizationController {
// if (StringUtils.isBlank(authUser.getCode()) || !authUser.getCode().equalsIgnoreCase(code)) {
// throw new BadRequestException("验证码错误");
// }
smfApi
.
canLogin
(
authUser
.
getUsername
(),
"123456"
);
UsernamePasswordAuthenticationToken
authenticationToken
=
new
UsernamePasswordAuthenticationToken
(
authUser
.
getUsername
(),
password
);
Authentication
authentication
=
authenticationManagerBuilder
.
getObject
().
authenticate
(
authenticationToken
);
...
...
src/main/java/com/neotel/smfcore/security/service/UserDetailsServiceImpl.java
查看文件 @
48206af
...
...
@@ -41,11 +41,9 @@ import java.util.stream.Collectors;
public
class
UserDetailsServiceImpl
implements
UserDetailsService
{
private
final
IUserManager
userManager
;
private
final
IMenuManager
menuManager
;
private
final
SmfApi
smfApi
;
@Override
public
JwtUserDto
loadUserByUsername
(
String
username
)
{
smfApi
.
canLogin
(
username
,
""
);
boolean
searchDb
=
true
;
JwtUserDto
jwtUserDto
=
null
;
if
(
searchDb
)
{
...
...
src/main/resources/messages.properties
查看文件 @
48206af
...
...
@@ -341,6 +341,9 @@ smfcore.selfAudit.notFind=\u672A\u627E\u5230\u76D8\u70B9\u4FE1\u606F
smfcore.selfAudit.pause
=
\u
76D8
\u
70B9{0}
\u
5DF2
\u6682\u
505C
smfcore.shelf.error.orderError
=
\u
4EFB
\u
52A1
\u
4E0E
\u6307\u
5B9A
\u
5DE5
\u5355
[{0}]
\u
4E0D
\u
4E00
\u
81F4
smfcore.shelf.error.storageError
=
\u
4EFB
\u
52A1
\u
4E0E
\u6307\u
5B9A
\u6599\u
67B6[{0}]
\u
4E0D
\u
4E00
\u
81F4
order.error.executing
=
{0}
\u
5DF2
\u5728\u
4EFB
\u
52A1
\u5217\u8868\u
4E2D
smfcore.queryPos.solderOutFail
=
[{0}]checkOut fail,currStatus[{1}]
smfcore.operationFailure
=
\u
64CD
\u
4F5C
\u5931\u
8D25
#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.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F
...
...
src/main/resources/messages_en_US.properties
查看文件 @
48206af
...
...
@@ -339,4 +339,7 @@ smfcore.selfAudit.hasEnd=[{0}] self audit is complete
smfcore.selfAudit.notFind
=
self audit is not found
smfcore.selfAudit.pause
=
self audit {0} has Paused
smfcore.shelf.error.orderError
=
Task does not match the assigned work order [{0}]
smfcore.shelf.error.storageError
=
Task does not match the specified shelf [{0}]
\ No newline at end of file
smfcore.shelf.error.storageError
=
Task does not match the specified shelf [{0}]
order.error.executing
=
{0} Already in the task list
smfcore.queryPos.solderOutFail
=
[{0}]checkOut fail,currStatus[{1}]
smfcore.operationFailure
=
Operation failed
\ No newline at end of file
src/main/resources/messages_ja_JP.properties
查看文件 @
48206af
...
...
@@ -336,4 +336,7 @@ smfcore.selfAudit.hasEnd=[{0}]\u30A4\u30F3\u30D9\u30F3\u30C8\u30EA\u30FC\u5B8C\u
smfcore.selfAudit.notFind
=
\u
30A4
\u
30F3
\u
30D9
\u
30F3
\u
30C8
\u
30EA
\u
60C5
\u5831\u
304C
\u
898B
\u3064\u
304B
\u3089\u
306A
\u3044
smfcore.selfAudit.pause=
\u
30BB
\u
30EB
\u
30D5
\u
30C6
\u
30B9
\u
30C8{0}
\u
304C
\u
4E2D
\u
65AD
\u3055\u
308C
\u
307E
\u3057\u
305F
smfcore.shelf.error.orderError
=
\u
4EFB
\u
52A1
\u
4E0E
\u6307\u
5B9A
\u
5DE5
\u5355
[{0}]
\u
4E0D
\u
4E00
\u
81F4
smfcore.shelf.error.storageError
=
\u
4EFB
\u
52A1
\u
4E0E
\u6307\u
5B9A
\u6599\u
67B6[{0}]
\u
4E0D
\u
4E00
\u
81F4
\ No newline at end of file
smfcore.shelf.error.storageError
=
\u
4EFB
\u
52A1
\u
4E0E
\u6307\u
5B9A
\u6599\u
67B6[{0}]
\u
4E0D
\u
4E00
\u
81F4
order.error.executing
=
{0}
\u
5DF2
\u5728\u
4EFB
\u
52A1
\u5217\u8868\u
4E2D
smfcore.queryPos.solderOutFail
=
[{0}]checkOut fail,currStatus[{1}]
smfcore.operationFailure
=
\u
64CD
\u
4F5C
\u5931\u
8D25
\ No newline at end of file
src/main/resources/messages_zh_CN.properties
查看文件 @
48206af
...
...
@@ -336,4 +336,7 @@ smfcore.selfAudit.hasEnd=[{0}]\u76D8\u70B9\u5DF2\u5B8C\u6210
smfcore.selfAudit.notFind
=
\u
672A
\u
627E
\u5230\u
76D8
\u
70B9
\u
4FE1
\u
606F
smfcore.selfAudit.pause
=
\u
76D8
\u
70B9{0}
\u
5DF2
\u6682\u
505C
smfcore.shelf.error.orderError
=
\u
4EFB
\u
52A1
\u
4E0E
\u6307\u
5B9A
\u
5DE5
\u5355
[{0}]
\u
4E0D
\u
4E00
\u
81F4
smfcore.shelf.error.storageError
=
\u
4EFB
\u
52A1
\u
4E0E
\u6307\u
5B9A
\u6599\u
67B6[{0}]
\u
4E0D
\u
4E00
\u
81F4
\ No newline at end of file
smfcore.shelf.error.storageError
=
\u
4EFB
\u
52A1
\u
4E0E
\u6307\u
5B9A
\u6599\u
67B6[{0}]
\u
4E0D
\u
4E00
\u
81F4
order.error.executing
=
{0}
\u
5DF2
\u5728\u
4EFB
\u
52A1
\u5217\u8868\u
4E2D
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
\ No newline at end of file
src/main/resources/messages_zh_TW.properties
查看文件 @
48206af
...
...
@@ -337,4 +337,7 @@ smfcore.selfAudit.hasEnd=[{0}]\u76E4\u9EDE\u5DF2\u5B8C\u6210
smfcore.selfAudit.notFind
=
\u
672A
\u
627E
\u5230\u
76E4
\u
9EDE
\u
4FE1
\u
606F
smfcore.selfAudit.pause
=
\u
76E4
\u
9EDE{0}
\u
5DF2
\u
66AB
\u
505C
smfcore.shelf.error.orderError
=
\u
4EFB
\u
52D9
\u8207\u6307\u
5B9A
\u
5DE5
\u
55AE[{0}]
\u
4E0D
\u
4E00
\u
81F4
smfcore.shelf.error.storageError
=
\u
4EFB
\u
52D9
\u8207\u6307\u
5B9A
\u6599\u
67B6[{0}]
\u
4E0D
\u
4E00
\u
81F4
\ No newline at end of file
smfcore.shelf.error.storageError
=
\u
4EFB
\u
52D9
\u8207\u6307\u
5B9A
\u6599\u
67B6[{0}]
\u
4E0D
\u
4E00
\u
81F4
order.error.executing
=
{0}
\u
5DF2
\u5728\u
4EFB
\u
52D9
\u5217\u8868\u
4E2D
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
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论