Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 40dd58c2
由
zshaohui
编写于
2023-09-22 15:22:49 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
操作设备时,增加用户登录缓存信息
1 个父辈
a2c0459d
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
55 行增加
和
1 行删除
src/main/java/com/neotel/smfcore/common/exception/ApiException.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
src/main/java/com/neotel/smfcore/custom/micron20031/Micron20031Api.java
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpLoadController.java
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpUnloadController.java
src/main/java/com/neotel/smfcore/custom/micron20031/cache/LoginCache.java
src/main/java/com/neotel/smfcore/common/exception/ApiException.java
查看文件 @
40dd58c
...
@@ -10,6 +10,7 @@ import java.text.MessageFormat;
...
@@ -10,6 +10,7 @@ import java.text.MessageFormat;
public
class
ApiException
extends
Exception
{
public
class
ApiException
extends
Exception
{
public
ApiException
(
String
message
){
public
ApiException
(
String
message
){
super
(
message
);
super
(
message
);
this
.
defaultMsg
=
message
;
}
}
public
String
msgKey
=
""
;
public
String
msgKey
=
""
;
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
查看文件 @
40dd58c
...
@@ -49,6 +49,7 @@ import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
...
@@ -49,6 +49,7 @@ import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.micron20031.Micron20031Api
;
import
com.neotel.smfcore.custom.micron20031.Micron20031Api
;
import
com.neotel.smfcore.custom.micron20031.bean.MInOutType
;
import
com.neotel.smfcore.custom.micron20031.bean.MInOutType
;
import
com.neotel.smfcore.custom.micron20031.cache.LoginCache
;
import
com.neotel.smfcore.security.service.manager.IGroupManager
;
import
com.neotel.smfcore.security.service.manager.IGroupManager
;
import
com.neotel.smfcore.custom.siemens.bean.LotCheckInfo
;
import
com.neotel.smfcore.custom.siemens.bean.LotCheckInfo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -108,6 +109,9 @@ public class BaseDeviceHandler implements IDeviceHandler {
...
@@ -108,6 +109,9 @@ public class BaseDeviceHandler implements IDeviceHandler {
@Autowired
@Autowired
private
IInOutDataManager
inOutDataManager
;
private
IInOutDataManager
inOutDataManager
;
@Autowired
private
LoginCache
loginCache
;
/**
/**
* CID的服务器消息(key 为 cid)
* CID的服务器消息(key 为 cid)
*/
*/
...
@@ -286,7 +290,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
...
@@ -286,7 +290,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
type
=
COMPONENT_TYPE
.
FIXTURE
;
type
=
COMPONENT_TYPE
.
FIXTURE
;
}
}
String
codeStr
=
statusBean
.
getCode
();
String
codeStr
=
statusBean
.
getCode
();
CodeValidateParam
params
=
new
CodeValidateParam
(
""
,
storage
.
getGroupId
(),
storage
.
getId
(),
codeStr
,
""
);
CodeValidateParam
params
=
new
CodeValidateParam
(
loginCache
.
getLoginUserName
(
storage
.
getCid
())
,
storage
.
getGroupId
(),
storage
.
getId
(),
codeStr
,
""
);
Barcode
barcodeSave
=
smfApi
.
canPutInBeforeResolve
(
params
);
Barcode
barcodeSave
=
smfApi
.
canPutInBeforeResolve
(
params
);
if
(
barcodeSave
==
null
){
if
(
barcodeSave
==
null
){
barcodeSave
=
codeResolve
.
resolveOneValideBarcode
(
codeStr
,
type
);
barcodeSave
=
codeResolve
.
resolveOneValideBarcode
(
codeStr
,
type
);
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/Micron20031Api.java
查看文件 @
40dd58c
...
@@ -11,7 +11,9 @@ import com.neotel.smfcore.common.utils.StringUtils;
...
@@ -11,7 +11,9 @@ import com.neotel.smfcore.common.utils.StringUtils;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.custom.micron20031.bean.DepositMatReqBean
;
import
com.neotel.smfcore.custom.micron20031.bean.DepositMatReqBean
;
import
com.neotel.smfcore.custom.micron20031.bean.MatOrderBean
;
import
com.neotel.smfcore.custom.micron20031.bean.MatOrderBean
;
import
com.neotel.smfcore.custom.micron20031.cache.LoginCache
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -181,6 +183,14 @@ public class Micron20031Api {
...
@@ -181,6 +183,14 @@ public class Micron20031Api {
}
}
}
}
private
static
LoginCache
loginCache
;
@Autowired
private
void
setLoginCache
(
LoginCache
cache
){
Micron20031Api
.
loginCache
=
cache
;
}
private
static
String
MATERIAL_TYPE
=
"SOLDER_PASTE"
;
private
static
String
MATERIAL_TYPE
=
"SOLDER_PASTE"
;
public
static
boolean
isEnable
(){
public
static
boolean
isEnable
(){
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpLoadController.java
查看文件 @
40dd58c
...
@@ -3,6 +3,7 @@ package com.neotel.smfcore.custom.micron20031;
...
@@ -3,6 +3,7 @@ package com.neotel.smfcore.custom.micron20031;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.inList.rest.bean.dto.InListDto
;
import
com.neotel.smfcore.core.inList.rest.bean.dto.InListDto
;
import
com.neotel.smfcore.core.inList.rest.bean.mapstruct.InListMapper
;
import
com.neotel.smfcore.core.inList.rest.bean.mapstruct.InListMapper
;
...
@@ -15,6 +16,7 @@ import com.neotel.smfcore.core.storage.service.manager.IStorageManager;
...
@@ -15,6 +16,7 @@ import com.neotel.smfcore.core.storage.service.manager.IStorageManager;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
import
com.neotel.smfcore.custom.micron20031.bean.DepositMatReqBean
;
import
com.neotel.smfcore.custom.micron20031.bean.DepositMatReqBean
;
import
com.neotel.smfcore.custom.micron20031.cache.LoginCache
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -46,6 +48,9 @@ public class MicronSpLoadController {
...
@@ -46,6 +48,9 @@ public class MicronSpLoadController {
@Autowired
@Autowired
private
DataCache
dataCache
;
private
DataCache
dataCache
;
@Autowired
private
LoginCache
loginCache
;
@ApiOperation
(
"获取入库单详情"
)
@ApiOperation
(
"获取入库单详情"
)
@GetMapping
(
value
=
"/desposit/getMatReqDetail"
)
@GetMapping
(
value
=
"/desposit/getMatReqDetail"
)
public
ResultBean
getMatReqDetail
(
String
matReqNo
)
{
public
ResultBean
getMatReqDetail
(
String
matReqNo
)
{
...
@@ -117,6 +122,9 @@ public class MicronSpLoadController {
...
@@ -117,6 +122,9 @@ public class MicronSpLoadController {
//设置开始入库
//设置开始入库
DevicesStatusUtil
.
appendOp
(
storage
.
getCid
(),
"closeInLock"
,
"doit"
);
DevicesStatusUtil
.
appendOp
(
storage
.
getCid
(),
"closeInLock"
,
"doit"
);
loginCache
.
updateLoginMap
(
storage
.
getCid
(),
SecurityUtils
.
getLoginUsername
());
return
ResultBean
.
newOkResult
(
matReqNo
);
return
ResultBean
.
newOkResult
(
matReqNo
);
}
}
...
@@ -138,6 +146,8 @@ public class MicronSpLoadController {
...
@@ -138,6 +146,8 @@ public class MicronSpLoadController {
//设置开始入库
//设置开始入库
DevicesStatusUtil
.
appendOp
(
storage
.
getCid
(),
"closeInLock"
,
"doit"
);
DevicesStatusUtil
.
appendOp
(
storage
.
getCid
(),
"closeInLock"
,
"doit"
);
loginCache
.
updateLoginMap
(
storage
.
getCid
(),
SecurityUtils
.
getLoginUsername
());
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpUnloadController.java
查看文件 @
40dd58c
...
@@ -19,6 +19,7 @@ import com.neotel.smfcore.core.storage.service.po.StoragePos;
...
@@ -19,6 +19,7 @@ import com.neotel.smfcore.core.storage.service.po.StoragePos;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.micron20031.bean.MInOutType
;
import
com.neotel.smfcore.custom.micron20031.bean.MInOutType
;
import
com.neotel.smfcore.custom.micron20031.bean.dto.SpUnloadDto
;
import
com.neotel.smfcore.custom.micron20031.bean.dto.SpUnloadDto
;
import
com.neotel.smfcore.custom.micron20031.cache.LoginCache
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -53,6 +54,9 @@ public class MicronSpUnloadController {
...
@@ -53,6 +54,9 @@ public class MicronSpUnloadController {
@Autowired
@Autowired
private
StoragePosMapper
storagePosMapper
;
private
StoragePosMapper
storagePosMapper
;
@Autowired
private
LoginCache
loginCache
;
@ApiOperation
(
"Withdraw Offline出库: GetEquipIDList"
)
@ApiOperation
(
"Withdraw Offline出库: GetEquipIDList"
)
...
@@ -144,6 +148,9 @@ public class MicronSpUnloadController {
...
@@ -144,6 +148,9 @@ public class MicronSpUnloadController {
if
(!
Strings
.
isNullOrEmpty
(
outResult
))
{
if
(!
Strings
.
isNullOrEmpty
(
outResult
))
{
throw
new
ValidateException
(
"smfcore.error"
,
outResult
);
throw
new
ValidateException
(
"smfcore.error"
,
outResult
);
}
}
loginCache
.
updateLoginMap
(
storage
.
getCid
(),
SecurityUtils
.
getLoginUsername
());
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
@@ -198,6 +205,7 @@ public class MicronSpUnloadController {
...
@@ -198,6 +205,7 @@ public class MicronSpUnloadController {
dtoResult
.
add
(
getUnloadDto
(
pos
,
unloakOk
));
dtoResult
.
add
(
getUnloadDto
(
pos
,
unloakOk
));
loginCache
.
updateLoginMap
(
storage
.
getCid
(),
SecurityUtils
.
getLoginUsername
());
}
}
return
ResultBean
.
newOkResult
(
dtoResult
);
return
ResultBean
.
newOkResult
(
dtoResult
);
}
}
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/cache/LoginCache.java
0 → 100644
查看文件 @
40dd58c
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
.
cache
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
@Service
public
class
LoginCache
{
Map
<
String
,
String
>
loginMap
=
new
ConcurrentHashMap
<>();
public
void
updateLoginMap
(
String
cid
,
String
userName
)
{
loginMap
.
put
(
cid
,
userName
);
}
public
String
getLoginUserName
(
String
cid
)
{
return
loginMap
.
get
(
cid
);
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论