Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4592f99c
由
LN
编写于
2024-07-15 09:12:45 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加MaxQuantity配置
1 个父辈
179519ac
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
32 行增加
和
3 行删除
src/main/java/com/neotel/smfcore/common/utils/Constants.java
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
src/main/java/com/neotel/smfcore/core/system/rest/SettingsController.java
src/main/java/com/neotel/smfcore/core/system/rest/bean/dto/SysSettingsDto.java
src/main/java/com/neotel/smfcore/custom/micron20031/Micron20031Api.java
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpUnloadController.java
src/main/java/com/neotel/smfcore/common/utils/Constants.java
查看文件 @
4592f99
...
...
@@ -174,4 +174,9 @@ public class Constants {
*/
public
static
final
String
CACHE_Deposit_Exceed_Time
=
"CACHE_Deposit_Exceed_Time"
;
/**
* 镁光接口使用
*/
public
static
final
String
CACHE_MaxQuantity
=
"CACHE_MaxQuantity"
;
}
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
4592f99
...
...
@@ -124,6 +124,10 @@ public class DataCache {
cacheMap
=
Maps
.
newConcurrentMap
();
List
<
CacheItem
>
all
=
cacheItemDao
.
findAll
();
for
(
CacheItem
cacheItem
:
all
)
{
if
(
cacheItem
==
null
||
ObjectUtil
.
isEmpty
(
cacheItem
.
getCacheKey
())||
cacheItem
.
getCacheValue
()==
null
){
log
.
error
(
"cacheItem为空,跳过"
);
continue
;
}
cacheMap
.
put
(
cacheItem
.
getCacheKey
(),
cacheItem
.
getCacheValue
());
}
if
(
cacheMap
.
get
(
Constants
.
CACHE_StopOut
)
==
null
)
{
...
...
src/main/java/com/neotel/smfcore/core/system/rest/SettingsController.java
查看文件 @
4592f99
...
...
@@ -82,6 +82,10 @@ public class SettingsController {
Integer
caWarn
=
dataCache
.
getCache
(
Constants
.
CACHE_CapacityWarn
);
Integer
backUpMonth
=
dataCache
.
getCache
(
Constants
.
BACKUP_MONTH_KEY
);
Integer
depositExceedTime
=
dataCache
.
getCache
(
Constants
.
CACHE_Deposit_Exceed_Time
);
int
MaxQuantity
=
dataCache
.
getCache
(
Constants
.
CACHE_MaxQuantity
);
if
(
MaxQuantity
<=
0
){
MaxQuantity
=
2
;
}
SysSettingsDto
dto
=
new
SysSettingsDto
();
dto
.
setStartJob
(
startJob
);
dto
.
setStopOut
(
stopOut
);
...
...
@@ -90,6 +94,7 @@ public class SettingsController {
dto
.
setCapacityWarn
(
caWarn
);
dto
.
setBackUpMonth
(
backUpMonth
);
dto
.
setDepositExceedTime
(
depositExceedTime
);
dto
.
setMaxQuantity
(
MaxQuantity
);
return
dto
;
}
...
...
@@ -104,9 +109,10 @@ public class SettingsController {
dataCache
.
updateCache
(
Constants
.
CACHE_CapacityWarn
,
sysSettingsDto
.
getCapacityWarn
());
dataCache
.
updateCache
(
Constants
.
BACKUP_MONTH_KEY
,
sysSettingsDto
.
getBackUpMonth
());
dataCache
.
updateCache
(
Constants
.
CACHE_Deposit_Exceed_Time
,
sysSettingsDto
.
getDepositExceedTime
());
dataCache
.
updateCache
(
Constants
.
CACHE_MaxQuantity
,
sysSettingsDto
.
getMaxQuantity
());
log
.
info
(
"更改系统设置:stopout="
+
sysSettingsDto
.
isStopOut
()
+
",stopjob="
+
sysSettingsDto
.
isStartJob
()+
",sluggishDay="
+
sysSettingsDto
.
getSluggishDay
()
+
",expiresDay="
+
sysSettingsDto
.
getExpiresDay
()+
",capacityWarn="
+
sysSettingsDto
.
getCapacityWarn
()+
",backUpMonth="
+
sysSettingsDto
.
getBackUpMonth
()
+
",depositExceedTime="
+
sysSettingsDto
.
getDepositExceedTime
());
+
",depositExceedTime="
+
sysSettingsDto
.
getDepositExceedTime
()
+
",maxQuantity="
+
sysSettingsDto
.
getMaxQuantity
()
);
return
ResultBean
.
newOkResult
(
"保存成功"
);
}
...
...
src/main/java/com/neotel/smfcore/core/system/rest/bean/dto/SysSettingsDto.java
查看文件 @
4592f99
...
...
@@ -30,4 +30,7 @@ public class SysSettingsDto implements Serializable {
@ApiModelProperty
(
"入库超时时间"
)
private
Integer
depositExceedTime
=
0
;
@ApiModelProperty
(
"允许LineId数量"
)
private
Integer
maxQuantity
=
2
;
}
src/main/java/com/neotel/smfcore/custom/micron20031/Micron20031Api.java
查看文件 @
4592f99
...
...
@@ -711,11 +711,14 @@ public class Micron20031Api {
* //Input: MicronPN, LotNo, BatchNo, SpoolStatus, Quantity, Username, Mode, MaterialType
* //Output: MicronPN, LotNo, BatchNo, SpoolStatus, Quantity, Username, Mode, MaterialType, MaterialDocumentNo, Message, Status
*/
public
static
void
chkAuthoriseToDispatch
(
Barcode
barcode
,
String
mode
,
String
username
,
String
lineId
)
throws
ApiException
{
public
static
void
chkAuthoriseToDispatch
(
Barcode
barcode
,
String
mode
,
String
username
,
String
lineId
,
int
MaxQuantity
)
throws
ApiException
{
String
checkStockAvailableUrl
=
getUrl
(
api_ChkAuthoriseToDispatch
);
if
(
ObjectUtil
.
isEmpty
(
checkStockAvailableUrl
))
{
return
;
}
// 1) 在 SMF UI 中 - 提供用于更新 MaxQuantity 的设置
// 2) 在 API 期间:ChkAuthoriseToDispatch ==>消息结构以包含 MaxQuantity
// 3) 如果 Neotel 可以调度或不调度,MMSIL 将返回结果。
String
auth
=
getAuthToken
();
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"MicronPN"
,
barcode
.
getPartNumber
());
...
...
@@ -728,6 +731,8 @@ public class Micron20031Api {
dataMap
.
put
(
"MaterialType"
,
MATERIAL_TYPE
);
dataMap
.
put
(
"EquipID"
,
lineId
);
dataMap
.
put
(
"LineID"
,
lineId
);
dataMap
.
put
(
"MaxQuantity"
,
MaxQuantity
);
log
.
info
(
"调用MES接口 ChkAuthoriseToDispatch,参数:"
+
JsonUtil
.
toJsonStr
(
dataMap
));
String
resultStr
=
HttpHelper
.
postJsonWithAuth
(
checkStockAvailableUrl
,
dataMap
,
auth
);
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpUnloadController.java
查看文件 @
4592f99
...
...
@@ -5,6 +5,7 @@ import com.google.common.base.Strings;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
...
...
@@ -25,6 +26,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.math3.analysis.function.Max
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.query.Criteria
;
...
...
@@ -101,7 +103,11 @@ public class MicronSpUnloadController {
posList
)
{
try
{
//验证
Micron20031Api
.
chkAuthoriseToDispatch
(
pos
.
getBarcode
(),
Micron20031Api
.
MODE_ENABLE_MAM_SAP
,
SecurityUtils
.
getCurrentUsername
(),
lineId
);
int
MaxQuantity
=
dataCache
.
getCache
(
Constants
.
CACHE_MaxQuantity
);
if
(
MaxQuantity
<=
0
){
MaxQuantity
=
2
;
}
Micron20031Api
.
chkAuthoriseToDispatch
(
pos
.
getBarcode
(),
Micron20031Api
.
MODE_ENABLE_MAM_SAP
,
SecurityUtils
.
getCurrentUsername
(),
lineId
,
MaxQuantity
);
log
.
info
(
"unload/getMicronPN ["
+
pn
+
"] barcode ["
+
pos
.
getBarcode
().
getBarcode
()
+
"] chkAuthoriseToDispatch 成功"
);
Barcode
barcode
=
pos
.
getBarcode
();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论