Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a4f7b982
由
LN
编写于
2025-12-11 13:59:15 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加最多点料次数设置。
1 个父辈
fb83d96a
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
114 行增加
和
14 行删除
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
src/main/java/com/neotel/smfcore/core/xRay/rest/XrayDeviceController.java
src/main/java/com/neotel/smfcore/custom/micron1053/bean/ExpConfig.java
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronGroupController.java
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronReportController.java
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
查看文件 @
a4f7b98
...
...
@@ -112,10 +112,44 @@ public class CodeResolve {
return
defaultExpiresDay
;
}
}
catch
(
Exception
ex
)
{
log
.
error
(
" getTargetValid ["
+
validDay
+
"] 出错:"
+
ex
.
toString
());
log
.
error
(
" getTargetValid ["
+
pn
+
"_"
+
manufacture
+
"]["
+
validDay
+
"] 出错:"
+
ex
.
toString
());
}
return
0
;
}
public
int
getMaxCountTimes
(
String
pn
,
String
manufacture
)
{
int
count
=
0
;
try
{
if
(
manufacture
==
null
)
{
manufacture
=
""
;
}
if
(
configList
==
null
)
{
return
count
;
}
for
(
ExpConfig
conf
:
configList
)
{
if
(
pn
.
startsWith
(
conf
.
getKey
())
&&
conf
.
getManufacture
().
equals
(
manufacture
))
{
count
=
conf
.
getMaxCountTimes
();
break
;
}
}
if
(
count
<=
0
)
{
for
(
ExpConfig
conf
:
configList
)
{
if
(
pn
.
startsWith
(
conf
.
getKey
())
&&
ObjectUtil
.
isEmpty
(
conf
.
getManufacture
()))
{
count
=
conf
.
getMaxCountTimes
();
break
;
}
}
}
}
catch
(
Exception
ex
)
{
log
.
error
(
" getMaxCountTimes ["
+
pn
+
"_"
+
manufacture
+
"] 出错:"
+
ex
.
toString
());
}
return
count
;
}
/**
* 解析条码为单个 Barcode,自动保存到数据库
*/
...
...
@@ -311,10 +345,12 @@ public class CodeResolve {
if
(
MicronDataCache
.
GetReelType
(
barcode
.
getPlateSize
(),
barcode
.
getHeight
()).
equals
(
MicronDataCache
.
PCB
))
{
log
.
info
(
"重新设置PCB"
+
codeBeanFromRule
.
getCodeStr
()
+
"标签数量和实时数量为:"
+
currentLabelAmount
+
",点料次数="
+
barcode
.
getXrayCount
());
barcode
.
setAmount
(
currentLabelAmount
);
}
else
if
(
barcode
.
getXrayCount
()
>
0
)
{
log
.
info
(
"重新设置"
+
codeBeanFromRule
.
getCodeStr
()
+
"标签数量和实时数量为:"
+
currentLabelAmount
+
",点料次数="
+
barcode
.
getXrayCount
());
barcode
.
setAmount
(
currentLabelAmount
);
}
else
{
}
// else if (barcode.getXrayCount() > 0) {
// log.info("重新设置" + codeBeanFromRule.getCodeStr() + "标签数量和实时数量为:" + currentLabelAmount + ",点料次数=" + barcode.getXrayCount());
// barcode.setAmount(currentLabelAmount);
// }
else
{
log
.
info
(
"重新设置"
+
codeBeanFromRule
.
getCodeStr
()
+
"标签数量为:"
+
currentLabelAmount
+
",点料次数="
+
barcode
.
getXrayCount
());
}
needUpdate
=
true
;
...
...
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
a4f7b98
...
...
@@ -131,7 +131,7 @@ public class DataCache {
for
(
String
key
:
oldconfigMap
.
keySet
())
{
ExpConfig
config
=
new
ExpConfig
(
key
,
""
,
oldconfigMap
.
get
(
key
));
ExpConfig
config
=
new
ExpConfig
(
key
,
""
,
oldconfigMap
.
get
(
key
)
,
0
);
configs
.
add
(
config
);
}
...
...
src/main/java/com/neotel/smfcore/core/xRay/rest/XrayDeviceController.java
查看文件 @
a4f7b98
...
...
@@ -22,6 +22,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.HashMap
;
import
java.util.Map
;
@Slf4j
...
...
@@ -155,9 +158,10 @@ public class XrayDeviceController {
int
oldQty
=
barcode
.
getAmount
();
int
qty
=
NumberUtil
.
parseInt
(
amountStr
);
barcode
.
setAmount
(
qty
);
barcode
.
setXrayCount
(
barcode
.
getXrayCount
()+
1
);
barcodeManager
.
save
(
barcode
);
log
.
info
(
"点料信息:barcode:"
+
barcodeStr
+
",旧数量:"
+
oldQty
+
",新数量="
+
qty
+
"
"
);
log
.
info
(
"点料信息:barcode:"
+
barcodeStr
+
",旧数量:"
+
oldQty
+
",新数量="
+
qty
+
"
,已点料次数="
+
barcode
.
getXrayCount
()
);
return
ResultBean
.
newOkResult
(
qty
);
}
}
...
...
@@ -165,4 +169,45 @@ public class XrayDeviceController {
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"barcode"
,
barcodeStr
});
}
@ApiOperation
(
"1584:获取最多点料次数"
)
@RequestMapping
(
value
=
"getMaxCountTimes"
)
@AnonymousAccess
public
ResultBean
getMaxCountTimes
(
@RequestBody
Map
<
String
,
String
>
paramMaps
)
{
String
barcodeStr
=
paramMaps
.
get
(
"barcode"
);
String
fullBarcode
=
paramMaps
.
get
(
"fullCode"
);
boolean
needResolve
=
false
;
String
offlineMode
=
paramMaps
.
get
(
"offlineMode"
);
if
(
ObjectUtil
.
isNotEmpty
(
offlineMode
)
&&
offlineMode
.
equalsIgnoreCase
(
"true"
))
{
needResolve
=
true
;
}
if
(
StringUtils
.
isNotBlank
(
barcodeStr
))
{
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
barcodeStr
);
if
(
needResolve
&&
barcode
==
null
&&
ObjectUtil
.
isNotEmpty
(
fullBarcode
))
{
try
{
//解析条码
barcode
=
codeResolve
.
resolveOneValideBarcode
(
fullBarcode
);
}
catch
(
ValidateException
ex
)
{
log
.
error
(
ex
.
getDefaultMsg
());
}
}
if
(
barcode
!=
null
)
{
int
maxCount
=
codeResolve
.
getMaxCountTimes
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
());
DateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
proDate
=
barcode
.
getProduceDate
()
==
null
?
""
:
dateFormat
.
format
(
barcode
.
getProduceDate
());
String
expireDate
=
barcode
.
getExpireDate
()
==
null
?
""
:
dateFormat
.
format
(
barcode
.
getExpireDate
());
Map
<
String
,
Object
>
resMap
=
new
HashMap
<>();
resMap
.
put
(
"maxCountTimes"
,
maxCount
);
resMap
.
put
(
"produceDate"
,
proDate
);
resMap
.
put
(
"xrayCount"
,
barcode
.
getXrayCount
());
log
.
info
(
"getMaxCountTimes点料信息:barcode:"
+
barcode
.
getBarcode
()
+
",maxCount:"
+
maxCount
+
",proDate="
+
proDate
+
",已点料次数="
+
barcode
.
getXrayCount
());
return
ResultBean
.
newOkResult
(
resMap
);
}
}
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"barcode"
,
barcodeStr
});
}
}
src/main/java/com/neotel/smfcore/custom/micron1053/bean/ExpConfig.java
查看文件 @
a4f7b98
...
...
@@ -13,9 +13,22 @@ import java.io.Serializable;
@NoArgsConstructor
public
class
ExpConfig
implements
Serializable
{
/**
* PN开头
*/
private
String
key
;
/**
* 供应商
*/
private
String
manufacture
;
/**
* 过期天数
*/
private
Integer
value
;
/**
* 最大点料次数,0或未设置时不限制
*/
private
Integer
maxCountTimes
;
}
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronGroupController.java
查看文件 @
a4f7b98
...
...
@@ -40,11 +40,11 @@ public class MicronGroupController {
@ApiOperation
(
"增加过期设置"
)
@RequestMapping
(
"/addExpirationDateConfig"
)
@AnonymousAccess
public
ResultBean
addExpirationDateConfig
(
String
key
,
String
manufacture
,
int
value
)
{
public
ResultBean
addExpirationDateConfig
(
String
key
,
String
manufacture
,
int
value
,
int
maxCountTimes
)
{
if
(
ObjectUtil
.
isEmpty
(
manufacture
)){
manufacture
=
""
;
}
ExpConfig
config
=
new
ExpConfig
(
key
,
manufacture
,
value
);
ExpConfig
config
=
new
ExpConfig
(
key
,
manufacture
,
value
,
maxCountTimes
);
List
<
ExpConfig
>
configList
=
dataCache
.
getCache
((
Constants
.
CACHE_ExpirationDateConfig_N
));
if
(
configList
==
null
){
...
...
@@ -110,7 +110,7 @@ public class MicronGroupController {
@ApiOperation
(
"修改过期设置"
)
@RequestMapping
(
"/updateExpirationDateConfig"
)
@AnonymousAccess
public
ResultBean
updateExpirationDateConfig
(
String
key
,
String
manufacture
,
int
value
)
{
public
ResultBean
updateExpirationDateConfig
(
String
key
,
String
manufacture
,
int
value
,
int
maxCountTimes
)
{
if
(
ObjectUtil
.
isEmpty
(
manufacture
)){
manufacture
=
""
;
}
List
<
ExpConfig
>
configList
=
getConfigList
();
...
...
@@ -121,7 +121,7 @@ public class MicronGroupController {
break
;
}
}
ExpConfig
con
=
new
ExpConfig
(
key
,
manufacture
,
value
);
ExpConfig
con
=
new
ExpConfig
(
key
,
manufacture
,
value
,
maxCountTimes
);
if
(
index
>=
0
){
configList
.
set
(
index
,
con
);
}
else
{
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronReportController.java
查看文件 @
a4f7b98
...
...
@@ -327,14 +327,20 @@ public class MicronReportController {
List
<
MsgCountDto
>
list
=
messageManager
.
getParetoData
(
c
);
// List<MessageDto> dtos=messageMapper.toDto(list);
Locale
locale
=
request
.
getLocale
();
List
<
MsgCountDto
>
returnList
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
ObjectUtil
.
isNotEmpty
(
list
.
get
(
i
).
getMsgCode
()))
{
list
.
get
(
i
).
setMsg
(
MessageUtils
.
getText
(
list
.
get
(
i
).
getMsgCode
(),
list
.
get
(
i
).
getMsgParams
(),
locale
,
list
.
get
(
i
).
getId
()));
}
else
{
list
.
get
(
i
).
setMsg
(
list
.
get
(
i
).
getId
());
}
if
(
ObjectUtil
.
isNotEmpty
(
list
.
get
(
i
))){
returnList
.
add
(
list
.
get
(
i
));
}
}
return
list
;
return
returnList
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论