Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d2d78faf
由
zshaohui
编写于
2023-07-14 09:52:58 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
立臻功能优化
1 个父辈
8b434640
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
240 行增加
和
65 行删除
src/main/java/com/neotel/smfcore/common/init/DataInitManager.java
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/WarehouseController.java
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/InnerBoxRestController.java
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/VirtualRestController.java
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/util/OutLotInfoCache.java
src/main/java/com/neotel/smfcore/custom/lizhen/kanban/outer/OuterKanbanController.java
src/main/java/com/neotel/smfcore/custom/lizhen/report/bean/query/ReportQueryCondition.java
src/main/java/com/neotel/smfcore/custom/lizhen/report/inner/InnerReportController.java
src/main/java/com/neotel/smfcore/custom/lizhen/report/outer/OuterReportController.java
src/main/java/com/neotel/smfcore/custom/lizhen/util/ExpireDateUtil.java
src/main/java/com/neotel/smfcore/common/init/DataInitManager.java
查看文件 @
d2d78fa
...
@@ -135,6 +135,9 @@ public class DataInitManager {
...
@@ -135,6 +135,9 @@ public class DataInitManager {
}
}
log
.
info
(
"创建菜单:"
+
menu
.
toString
());
log
.
info
(
"创建菜单:"
+
menu
.
toString
());
dbMenu
=
menuManager
.
saveMenu
(
menu
);
dbMenu
=
menuManager
.
saveMenu
(
menu
);
}
else
{
dbMenu
.
setTitle
(
menu
.
getTitle
());
dbMenu
=
menuManager
.
saveMenu
(
dbMenu
);
}
}
return
dbMenu
;
return
dbMenu
;
}
}
...
@@ -238,7 +241,7 @@ public class DataInitManager {
...
@@ -238,7 +241,7 @@ public class DataInitManager {
addNewFunctionMenu
(
91
,
pMenuReport
,
"imDetailsReport"
,
"导入明细"
,
"imDetailsReport"
,
"innerWarehouse/imDetailsReport/index"
,
"feeding"
,
functionMenuMap
);
addNewFunctionMenu
(
91
,
pMenuReport
,
"imDetailsReport"
,
"导入明细"
,
"imDetailsReport"
,
"innerWarehouse/imDetailsReport/index"
,
"feeding"
,
functionMenuMap
);
//内外仓都有
//内外仓都有
addNewFunctionMenu
(
92
,
pMenuReport
,
"expiredReport"
,
"
物料状态
"
,
"expiredReport"
,
"report/expiredReport/index"
,
"inventory"
,
functionMenuMap
);
addNewFunctionMenu
(
92
,
pMenuReport
,
"expiredReport"
,
"
库存物料状态表
"
,
"expiredReport"
,
"report/expiredReport/index"
,
"inventory"
,
functionMenuMap
);
//可观测性:物料追踪
//可观测性:物料追踪
Menu
guanceMenu
=
Menu
.
CreatePMenu
(
"可观测性"
,
8
,
"observability"
,
2
,
"scanKey"
,
null
);
Menu
guanceMenu
=
Menu
.
CreatePMenu
(
"可观测性"
,
8
,
"observability"
,
2
,
"scanKey"
,
null
);
...
...
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
查看文件 @
d2d78fa
...
@@ -166,6 +166,13 @@ public class CodeResolve {
...
@@ -166,6 +166,13 @@ public class CodeResolve {
barcode
.
setProviderNumber
(
providerNumber
);
barcode
.
setProviderNumber
(
providerNumber
);
needUpdate
=
true
;
needUpdate
=
true
;
}
}
//判断供应商
String
provider
=
barcodeFromRule
.
getProvider
();
if
(
StringUtils
.
isNotBlank
(
provider
)){
barcode
.
setProvider
(
provider
);
needUpdate
=
true
;
}
//判断日期代码
//判断日期代码
String
dateCode
=
barcodeFromRule
.
getDateCode
();
String
dateCode
=
barcodeFromRule
.
getDateCode
();
if
(
StringUtils
.
isNotBlank
(
dateCode
)){
if
(
StringUtils
.
isNotBlank
(
dateCode
)){
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLShelfHandler.java
查看文件 @
d2d78fa
...
@@ -432,14 +432,26 @@ public class NLShelfHandler extends BaseDeviceHandler {
...
@@ -432,14 +432,26 @@ public class NLShelfHandler extends BaseDeviceHandler {
}
}
Barcode
barcodeApi
=
lizhenApi
.
barcodeInfo
(
barcode
);
Barcode
barcodeApi
=
lizhenApi
.
barcodeInfo
(
barcode
);
if
(
barcodeApi
!=
null
){
//判断返回过来的物料数量与标签上的是否一致,如果不一致,则调用散料量测接口
//如果是L开头的去量测
if
(
barcodeApi
.
getAmount
()
!=
barcode
.
getLabelAmount
())
{
if
(
barcode
.
getBarcode
().
startsWith
(
"L"
)
||
barcode
.
getBarcode
().
startsWith
(
"l"
))
{
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
if
(!
check
)
{
if
(!
check
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"散料未量测"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"散料未量测"
);
}
}
else
{
if
(
barcodeApi
!=
null
)
{
//判断返回过来的物料数量与标签上的是否一致,如果不一致,则调用散料量测接口
if
(
barcodeApi
.
getAmount
()
!=
barcode
.
getLabelAmount
())
{
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
if
(!
check
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"散料未量测"
);
}
}
}
}
}
}
if
(
barcodeApi
!=
null
){
barcode
=
barcodeApi
;
barcode
=
barcodeApi
;
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
d2d78fa
...
@@ -214,14 +214,26 @@ public class DeviceController {
...
@@ -214,14 +214,26 @@ public class DeviceController {
}
}
Barcode
barcodeApi
=
lizhenApi
.
barcodeInfo
(
barcode
);
Barcode
barcodeApi
=
lizhenApi
.
barcodeInfo
(
barcode
);
if
(
barcodeApi
!=
null
){
//判断返回过来的物料数量与标签上的是否一致,如果不一致,则调用散料量测接口
//如果是L开头的去量测
if
(
barcodeApi
.
getAmount
()
!=
barcode
.
getLabelAmount
())
{
if
(
barcode
.
getBarcode
().
startsWith
(
"L"
)
||
barcode
.
getBarcode
().
startsWith
(
"l"
))
{
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
if
(!
check
)
{
if
(!
check
)
{
throw
new
ValidateException
(
""
,
barcode
.
getBarcode
()
+
"散料未量测"
);
throw
new
ValidateException
(
""
,
barcode
.
getBarcode
()
+
"散料未量测"
);
}
}
else
{
if
(
barcodeApi
!=
null
)
{
//判断返回过来的物料数量与标签上的是否一致,如果不一致,则调用散料量测接口
if
(
barcodeApi
.
getAmount
()
!=
barcode
.
getLabelAmount
())
{
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
if
(!
check
)
{
throw
new
ValidateException
(
""
,
barcode
.
getBarcode
()
+
"散料未量测"
);
}
}
}
}
}
}
if
(
barcodeApi
!=
null
){
barcode
=
barcodeApi
;
barcode
=
barcodeApi
;
}
}
...
...
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
d2d78fa
...
@@ -1149,19 +1149,22 @@ public class LiteOrderCache {
...
@@ -1149,19 +1149,22 @@ public class LiteOrderCache {
for
(
StoragePos
pos
:
storagePosList
)
{
for
(
StoragePos
pos
:
storagePosList
)
{
for
(
Barcode
barcode
:
pos
.
getBarcode
().
getSubCodeList
())
{
for
(
Barcode
barcode
:
pos
.
getBarcode
().
getSubCodeList
())
{
if
(
barcode
.
getPartNumber
().
equals
(
partNumber
))
{
if
(
barcode
.
getPartNumber
().
equals
(
partNumber
))
{
if
(
barcode
.
getExpireDate
()
==
null
)
{
barcode
.
setExpireDate
(
new
Date
());
}
barcodeList
.
add
(
barcode
);
barcodeList
.
add
(
barcode
);
}
}
}
}
}
}
//按排序找到最
早
入库的partNumber
//按排序找到最
先过期
入库的partNumber
if
(
barcodeList
!=
null
&&
!
barcodeList
.
isEmpty
())
{
if
(
barcodeList
!=
null
&&
!
barcodeList
.
isEmpty
())
{
List
<
String
>
posNameList
=
barcodeList
.
stream
().
sorted
(
Comparator
.
comparing
(
Barcode:
:
get
Creat
eDate
)).
map
(
item
->
item
.
getPosName
()).
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
posNameList
=
barcodeList
.
stream
().
sorted
(
Comparator
.
comparing
(
Barcode:
:
get
Expir
eDate
)).
map
(
item
->
item
.
getPosName
()).
distinct
().
collect
(
Collectors
.
toList
());
for
(
String
posName
:
posNameList
)
{
for
(
String
posName
:
posNameList
)
{
for
(
StoragePos
pos
:
storagePosList
)
{
for
(
StoragePos
pos
:
storagePosList
)
{
if
(
StringUtils
.
isNotBlank
(
posName
))
{
if
(
StringUtils
.
isNotBlank
(
posName
))
{
if
(
posName
.
startsWith
(
pos
.
getBarcode
().
getBarcode
()))
{
if
(
posName
.
startsWith
(
pos
.
getBarcode
().
getBarcode
()))
{
return
pos
;
return
pos
;
}
}
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
查看文件 @
d2d78fa
...
@@ -348,7 +348,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
...
@@ -348,7 +348,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
}
}
Query
q
=
new
Query
(
c
);
Query
q
=
new
Query
(
c
);
//Sort sort = getSortByCheckOutType(checkOutType);
//Sort sort = getSortByCheckOutType(checkOutType);
Sort
sort
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"barcode.amount"
,
"barcode.
creat
eDate"
);
Sort
sort
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"barcode.amount"
,
"barcode.
expir
eDate"
);
q
.
with
(
sort
);
q
.
with
(
sort
);
StoragePos
pos
=
storagePosDao
.
findOne
(
q
);
StoragePos
pos
=
storagePosDao
.
findOne
(
q
);
if
(
pos
==
null
)
{
if
(
pos
==
null
)
{
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
查看文件 @
d2d78fa
...
@@ -88,11 +88,16 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -88,11 +88,16 @@ public class LizhenApi extends DefaultSmfApiListener {
*/
*/
public
Map
<
String
,
Object
>
brandQty
(
String
partnumber
,
String
brand
)
{
public
Map
<
String
,
Object
>
brandQty
(
String
partnumber
,
String
brand
)
{
log
.
info
(
"brandQty--material_code:"
+
partnumber
+
",brand:"
+
brand
);
log
.
info
(
"brandQty--material_code:"
+
partnumber
+
",brand:"
+
brand
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
if
(
StringUtils
.
isBlank
(
brandQtyUrl
)){
resultMap
.
put
(
"qty"
,
0
);
resultMap
.
put
(
"reelSize"
,
0
);
return
resultMap
;
}
int
qty
=
0
;
int
qty
=
0
;
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"material_code"
,
partnumber
);
paramMap
.
put
(
"material_code"
,
partnumber
);
paramMap
.
put
(
"brand"
,
brand
);
paramMap
.
put
(
"brand"
,
brand
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
try
{
try
{
String
result
=
HttpHelper
.
postJson
(
brandQtyUrl
,
paramMap
);
String
result
=
HttpHelper
.
postJson
(
brandQtyUrl
,
paramMap
);
log
.
info
(
"brandQty-"
+
partnumber
+
":请求结果为:"
+
result
);
log
.
info
(
"brandQty-"
+
partnumber
+
":请求结果为:"
+
result
);
...
@@ -557,6 +562,9 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -557,6 +562,9 @@ public class LizhenApi extends DefaultSmfApiListener {
* @return
* @return
*/
*/
public
boolean
checkReelMeasure
(
Barcode
barcode
)
{
public
boolean
checkReelMeasure
(
Barcode
barcode
)
{
if
(
StringUtils
.
isBlank
(
checkReelMeasureUrl
)){
return
true
;
}
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"reelID"
,
barcode
.
getBarcode
());
paramMap
.
put
(
"reelID"
,
barcode
.
getBarcode
());
paramMap
.
put
(
"ipn"
,
barcode
.
getPartNumber
());
paramMap
.
put
(
"ipn"
,
barcode
.
getPartNumber
());
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
查看文件 @
d2d78fa
...
@@ -96,7 +96,7 @@ public class OutLineController {
...
@@ -96,7 +96,7 @@ public class OutLineController {
@ApiOperation
(
"线外扫码入库"
)
@ApiOperation
(
"线外扫码入库"
)
@RequestMapping
(
"/operatePos"
)
@RequestMapping
(
"/operatePos"
)
@AnonymousAccess
@AnonymousAccess
public
synchronized
ResultBean
operatePos
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
public
ResultBean
operatePos
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
name
=
paramMap
.
get
(
"name"
);
//当前工位名称
String
name
=
paramMap
.
get
(
"name"
);
//当前工位名称
String
code
=
paramMap
.
get
(
"code"
);
//传入的物料信息
String
code
=
paramMap
.
get
(
"code"
);
//传入的物料信息
String
size
=
paramMap
.
get
(
"size"
);
//尺寸信息
String
size
=
paramMap
.
get
(
"size"
);
//尺寸信息
...
@@ -243,17 +243,30 @@ public class OutLineController {
...
@@ -243,17 +243,30 @@ public class OutLineController {
}
}
//获取mes数量
//获取mes数量
Barcode
barcodeInfo
=
lizhenApi
.
barcodeInfo
(
barcode
);
Barcode
barcodeApi
=
lizhenApi
.
barcodeInfo
(
barcode
);
if
(
barcodeInfo
!=
null
){
//判断返回过来的物料数量与标签上的是否一致,如果不一致,则调用散料量测接口
//如果是L开头的去量测
if
(
barcodeInfo
.
getAmount
()
!=
barcode
.
getLabelAmount
())
{
if
(
barcode
.
getBarcode
().
startsWith
(
"L"
)
||
barcode
.
getBarcode
().
startsWith
(
"l"
))
{
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
if
(!
check
)
{
if
(!
check
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()+
"散料未量测"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"散料未量测"
);
}
}
else
{
if
(
barcodeApi
!=
null
)
{
//判断返回过来的物料数量与标签上的是否一致,如果不一致,则调用散料量测接口
if
(
barcodeApi
.
getAmount
()
!=
barcode
.
getLabelAmount
())
{
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
if
(!
check
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"散料未量测"
);
}
}
}
}
}
barcode
=
barcodeInfo
;
}
}
if
(
barcodeApi
!=
null
){
barcode
=
barcodeApi
;
}
barcode
.
setReelAmount
(
1
);
barcode
.
setReelAmount
(
1
);
barcode
.
setWarehouseCode
(
warehouseCode
);
barcode
.
setWarehouseCode
(
warehouseCode
);
barcode
.
setPosName
(
boxPartition
);
barcode
.
setPosName
(
boxPartition
);
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/WarehouseController.java
查看文件 @
d2d78fa
...
@@ -413,17 +413,30 @@ public class WarehouseController {
...
@@ -413,17 +413,30 @@ public class WarehouseController {
}
}
//获取mes数量
//获取mes数量
Barcode
barcodeInfo
=
lizhenApi
.
barcodeInfo
(
barcode
);
Barcode
barcodeApi
=
lizhenApi
.
barcodeInfo
(
barcode
);
if
(
barcodeInfo
!=
null
)
{
//判断返回过来的物料数量与标签上的是否一致,如果不一致,则调用散料量测接口
//如果是L开头的去量测
if
(
barcodeInfo
.
getAmount
()
!=
barcode
.
getLabelAmount
())
{
if
(
barcode
.
getBarcode
().
startsWith
(
"L"
)
||
barcode
.
getBarcode
().
startsWith
(
"l"
))
{
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
if
(!
check
)
{
if
(!
check
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()+
"散料未量测"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"散料未量测"
);
}
}
else
{
if
(
barcodeApi
!=
null
)
{
//判断返回过来的物料数量与标签上的是否一致,如果不一致,则调用散料量测接口
if
(
barcodeApi
.
getAmount
()
!=
barcode
.
getLabelAmount
())
{
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
if
(!
check
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"散料未量测"
);
}
}
}
}
}
barcode
=
barcodeInfo
;
}
}
if
(
barcodeApi
!=
null
){
barcode
=
barcodeApi
;
}
//当前已扫描的料卷数量+1
//当前已扫描的料卷数量+1
int
reelCurrentNum
=
station
.
getReelCurrentNum
();
int
reelCurrentNum
=
station
.
getReelCurrentNum
();
station
.
setReelCurrentNum
(
reelCurrentNum
+
1
);
station
.
setReelCurrentNum
(
reelCurrentNum
+
1
);
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/InnerBoxRestController.java
查看文件 @
d2d78fa
...
@@ -440,6 +440,17 @@ public class InnerBoxRestController {
...
@@ -440,6 +440,17 @@ public class InnerBoxRestController {
}
}
@ApiOperation
(
"博众agv获取小车目的地"
)
@RequestMapping
(
"/getBoZhongAgvLineInfo"
)
@AnonymousAccess
public
ResultBean
getBoZhongAgvLineInfo
(
HttpServletRequest
request
)
{
String
rfid
=
request
.
getParameter
(
"rfid"
);
OutLotInfo
outLotInfo
=
OutLotInfoCache
.
getOutLotInfoByRfidMap
(
rfid
);
log
.
info
(
"获取博众AGV目的地---rfid为:"
+
rfid
+
",outLotInfo为:"
+
JsonUtil
.
toJsonStr
(
outLotInfo
));
return
ResultBean
.
newOkResult
(
outLotInfo
.
getLine
());
}
@ApiOperation
(
"清理料箱信息"
)
@ApiOperation
(
"清理料箱信息"
)
@RequestMapping
(
"/clearRfidInfo"
)
@RequestMapping
(
"/clearRfidInfo"
)
@AnonymousAccess
@AnonymousAccess
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/VirtualRestController.java
查看文件 @
d2d78fa
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
.
innerBox
.
rest
;
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
.
innerBox
.
rest
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -28,6 +29,7 @@ import com.neotel.smfcore.custom.lizhen.LizhenApi;
...
@@ -28,6 +29,7 @@ import com.neotel.smfcore.custom.lizhen.LizhenApi;
import
com.neotel.smfcore.custom.lizhen.innerBox.bean.VirImportLog
;
import
com.neotel.smfcore.custom.lizhen.innerBox.bean.VirImportLog
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.custom.lizhen.innerBox.service.manager.IVirImportLogManager
;
import
com.neotel.smfcore.custom.lizhen.innerBox.service.manager.IVirImportLogManager
;
import
com.neotel.smfcore.custom.lizhen.util.ExpireDateUtil
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -129,17 +131,30 @@ public class VirtualRestController {
...
@@ -129,17 +131,30 @@ public class VirtualRestController {
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.partNumber.invalid"
,
"{0}不是有效的料号"
,
new
String
[]{
barcode
.
getPartNumber
()});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.partNumber.invalid"
,
"{0}不是有效的料号"
,
new
String
[]{
barcode
.
getPartNumber
()});
}
}
Barcode
barcodeInfo
=
lizhenApi
.
barcodeInfo
(
barcode
);
Barcode
barcodeApi
=
lizhenApi
.
barcodeInfo
(
barcode
);
if
(
barcodeInfo
!=
null
){
//判断返回过来的物料数量与标签上的是否一致,如果不一致,则调用散料量测接口
//如果是L开头的去量测
if
(
barcodeInfo
.
getAmount
()
!=
barcode
.
getLabelAmount
())
{
if
(
barcode
.
getBarcode
().
startsWith
(
"L"
)
||
barcode
.
getBarcode
().
startsWith
(
"l"
))
{
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
if
(!
check
)
{
if
(!
check
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"散料未量测"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"散料未量测"
);
}
}
else
{
if
(
barcodeApi
!=
null
)
{
//判断返回过来的物料数量与标签上的是否一致,如果不一致,则调用散料量测接口
if
(
barcodeApi
.
getAmount
()
!=
barcode
.
getLabelAmount
())
{
boolean
check
=
lizhenApi
.
checkReelMeasure
(
barcode
);
if
(!
check
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"散料未量测"
);
}
}
}
}
}
barcode
=
barcodeInfo
;
}
}
if
(
barcodeApi
!=
null
){
barcode
=
barcodeApi
;
}
//判断是否为禁用料
//判断是否为禁用料
try
{
try
{
smfApi
.
canPutInAfterResolve
(
barcode
);
smfApi
.
canPutInAfterResolve
(
barcode
);
...
@@ -333,6 +348,11 @@ public class VirtualRestController {
...
@@ -333,6 +348,11 @@ public class VirtualRestController {
barcode
.
setBarcode
(
barcodeStr
);
barcode
.
setBarcode
(
barcodeStr
);
barcode
.
setAmount
(
dataLog
.
getNum
());
barcode
.
setAmount
(
dataLog
.
getNum
());
barcode
.
setDateCode
(
dataLog
.
getDateCode
());
barcode
.
setDateCode
(
dataLog
.
getDateCode
());
Date
produceDate
=
ExpireDateUtil
.
getExpireDate
(
dataLog
.
getDateCode
(),
dataLog
.
getProvider
());
if
(
produceDate
!=
null
){
barcode
.
setProduceDate
(
produceDate
);
barcode
.
setExpireDate
(
DateUtil
.
offsetMonth
(
produceDate
,
12
));
}
barcode
.
setPartNumber
(
dataLog
.
getPartNumber
());
barcode
.
setPartNumber
(
dataLog
.
getPartNumber
());
barcode
.
setBatch
(
dataLog
.
getBatchInfo
());
barcode
.
setBatch
(
dataLog
.
getBatchInfo
());
barcode
.
setProvider
(
dataLog
.
getProvider
());
barcode
.
setProvider
(
dataLog
.
getProvider
());
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/util/OutLotInfoCache.java
查看文件 @
d2d78fa
...
@@ -127,6 +127,19 @@ public class OutLotInfoCache {
...
@@ -127,6 +127,19 @@ public class OutLotInfoCache {
return
outLotInfo
;
return
outLotInfo
;
}
}
public
static
OutLotInfo
getOutLotInfoByRfidMap
(
String
rfid
)
{
OutLotInfo
outLotInfo
=
new
OutLotInfo
();
for
(
List
<
OutLotInfo
>
infoList
:
outLotInfoMap
.
values
())
{
for
(
OutLotInfo
lotInfo
:
infoList
)
{
if
(
lotInfo
.
getRfid
().
startsWith
(
rfid
)){
return
lotInfo
;
}
}
}
return
outLotInfo
;
}
public
static
void
outLotInfoMapToOutInfos
(
String
outlet
,
String
rfid
)
{
public
static
void
outLotInfoMapToOutInfos
(
String
outlet
,
String
rfid
)
{
OutLotInfo
outLotInfo
=
null
;
OutLotInfo
outLotInfo
=
null
;
for
(
Map
.
Entry
<
String
,
List
<
OutLotInfo
>>
outLotInfoEntry
:
outLotInfoMap
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
List
<
OutLotInfo
>>
outLotInfoEntry
:
outLotInfoMap
.
entrySet
())
{
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/kanban/outer/OuterKanbanController.java
查看文件 @
d2d78fa
...
@@ -48,7 +48,11 @@ public class OuterKanbanController {
...
@@ -48,7 +48,11 @@ public class OuterKanbanController {
@Autowired
@Autowired
private
IBarcodeManager
barcodeManager
;
private
IBarcodeManager
barcodeManager
;
public
static
final
Map
<
String
,
Long
>
expireMap
=
Maps
.
newConcurrentMap
();
public
static
Map
<
String
,
Long
>
expireMap
=
Maps
.
newConcurrentMap
();
public
static
Long
stationInOutTime
=
null
;
public
static
List
<
StationInOutDto
>
dtoList
=
new
ArrayList
<>();
/**
/**
* 获取近7天出入库统计
* 获取近7天出入库统计
...
@@ -84,20 +88,25 @@ public class OuterKanbanController {
...
@@ -84,20 +88,25 @@ public class OuterKanbanController {
@AnonymousAccess
@AnonymousAccess
public
ResultBean
getStationInAndOutAmout
()
throws
ParseException
{
public
ResultBean
getStationInAndOutAmout
()
throws
ParseException
{
List
<
StationInOutDto
>
resultList
=
new
ArrayList
<>();
List
<
StationInOutDto
>
resultList
=
new
ArrayList
<>();
Date
currentDate
=
KanbanUtils
.
getCurrentDate
();
if
(
stationInOutTime
==
null
||
System
.
currentTimeMillis
()
-
stationInOutTime
>=
1000
*
60
*
5
)
{
//currentDate = DateUtil.addDays(currentDate,-1);
//先把缓存清空
Date
endDate
=
DateUtil
.
addDays
(
currentDate
,
1
);
dtoList
.
clear
();
for
(
int
i
=
1
;
i
<
6
;
i
++)
{
//开始统计值
StationInOutDto
dto
=
new
StationInOutDto
();
Date
currentDate
=
KanbanUtils
.
getCurrentDate
();
String
stationName
=
"s"
+
i
;
Date
endDate
=
DateUtil
.
addDays
(
currentDate
,
1
);
dto
.
setName
(
stationName
.
toUpperCase
(
Locale
.
ROOT
));
for
(
int
i
=
1
;
i
<
6
;
i
++)
{
int
inCount
=
dataLogManager
.
getInOutData
(
currentDate
,
endDate
,
OP
.
PUT_IN
,
stationName
);
StationInOutDto
dto
=
new
StationInOutDto
();
dto
.
setInCount
(
inCount
);
String
stationName
=
"S"
+
i
;
int
outCount
=
dataLogManager
.
getInOutData
(
currentDate
,
endDate
,
OP
.
CHECKOUT
,
stationName
);
dto
.
setName
(
stationName
.
toUpperCase
(
Locale
.
ROOT
));
dto
.
setOutCount
(
outCount
);
int
inCount
=
dataLogManager
.
getInOutData
(
currentDate
,
endDate
,
OP
.
PUT_IN
,
stationName
);
resultList
.
add
(
dto
);
dto
.
setInCount
(
inCount
);
int
outCount
=
dataLogManager
.
getInOutData
(
currentDate
,
endDate
,
OP
.
CHECKOUT
,
stationName
);
dto
.
setOutCount
(
outCount
);
dtoList
.
add
(
dto
);
}
stationInOutTime
=
System
.
currentTimeMillis
();
}
}
return
ResultBean
.
newOkResult
(
result
List
);
return
ResultBean
.
newOkResult
(
dto
List
);
}
}
/**
/**
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/report/bean/query/ReportQueryCondition.java
查看文件 @
d2d78fa
...
@@ -107,6 +107,9 @@ public class ReportQueryCondition {
...
@@ -107,6 +107,9 @@ public class ReportQueryCondition {
//楼层
//楼层
private
String
floor
;
private
String
floor
;
//过期状态
private
String
expireStatus
;
private
int
page
;
private
int
page
;
private
int
size
;
private
int
size
;
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/report/inner/InnerReportController.java
查看文件 @
d2d78fa
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/custom/lizhen/report/outer/OuterReportController.java
查看文件 @
d2d78fa
...
@@ -792,7 +792,30 @@ public class OuterReportController {
...
@@ -792,7 +792,30 @@ public class OuterReportController {
@AnonymousAccess
@AnonymousAccess
public
PageData
<
ExpireDto
>
expireInfo
(
ReportQueryCondition
queryCondition
,
Pageable
pageable
)
{
public
PageData
<
ExpireDto
>
expireInfo
(
ReportQueryCondition
queryCondition
,
Pageable
pageable
)
{
Query
query
=
QueryHelp
.
getQuery
(
queryCondition
);
Query
query
=
QueryHelp
.
getQuery
(
queryCondition
);
query
.
addCriteria
(
Criteria
.
where
(
"posName"
).
exists
(
true
).
ne
(
""
).
and
(
"partNumber"
).
nin
(
Arrays
.
asList
(
"CS"
,
"CM"
,
"CB"
))
/*.and("expireDate").lt(new Date())*/
);
Criteria
c
=
Criteria
.
where
(
"posName"
).
exists
(
true
).
ne
(
""
).
and
(
"partNumber"
).
nin
(
Arrays
.
asList
(
"CS"
,
"CM"
,
"CB"
));
//判断传入的类型
String
expireStatus
=
queryCondition
.
getExpireStatus
();
Date
startDate
,
endDate
;
if
(
"0"
.
equals
(
expireStatus
))
{
startDate
=
new
Date
();
endDate
=
DateUtil
.
offsetDay
(
startDate
,
7
);
c
.
and
(
"expireDate"
).
gte
(
startDate
).
lt
(
endDate
);
}
else
if
(
"1"
.
equals
(
expireStatus
))
{
startDate
=
DateUtil
.
offsetDay
(
new
Date
(),
7
);
endDate
=
DateUtil
.
offsetDay
(
new
Date
(),
30
);
c
.
and
(
"expireDate"
).
gte
(
startDate
).
lt
(
endDate
);
}
else
if
(
"2"
.
equals
(
expireStatus
))
{
List
<
Criteria
>
orCriList
=
new
ArrayList
<>();
orCriList
.
add
(
Criteria
.
where
(
"expireDate"
).
gt
(
new
Date
()).
and
(
"posName"
).
exists
(
true
).
ne
(
""
).
and
(
"partNumber"
).
nin
(
Arrays
.
asList
(
"CS"
,
"CM"
,
"CB"
)));
orCriList
.
add
(
Criteria
.
where
(
"expireDate"
).
exists
(
false
).
and
(
"posName"
).
exists
(
true
).
ne
(
""
).
and
(
"partNumber"
).
nin
(
Arrays
.
asList
(
"CS"
,
"CM"
,
"CB"
)));
c
.
orOperator
(
orCriList
);
}
else
if
(
"3"
.
equals
(
expireStatus
))
{
endDate
=
new
Date
();
c
.
and
(
"expireDate"
).
lt
(
endDate
);
}
query
.
addCriteria
(
c
);
int
count
=
barcodeManager
.
countByQuery
(
query
);
int
count
=
barcodeManager
.
countByQuery
(
query
);
List
<
Barcode
>
barcodeList
=
barcodeManager
.
findByQuery
(
query
,
pageable
);
List
<
Barcode
>
barcodeList
=
barcodeManager
.
findByQuery
(
query
,
pageable
);
List
<
ExpireDto
>
expireDtoList
=
new
ArrayList
<>();
List
<
ExpireDto
>
expireDtoList
=
new
ArrayList
<>();
...
@@ -859,7 +882,29 @@ public class OuterReportController {
...
@@ -859,7 +882,29 @@ public class OuterReportController {
@AnonymousAccess
@AnonymousAccess
public
void
expireInfoDownload
(
ReportQueryCondition
queryCondition
,
Pageable
pageable
,
HttpServletResponse
response
)
throws
IOException
{
public
void
expireInfoDownload
(
ReportQueryCondition
queryCondition
,
Pageable
pageable
,
HttpServletResponse
response
)
throws
IOException
{
Query
query
=
QueryHelp
.
getQuery
(
queryCondition
);
Query
query
=
QueryHelp
.
getQuery
(
queryCondition
);
query
.
addCriteria
(
Criteria
.
where
(
"posName"
).
exists
(
true
).
ne
(
""
).
and
(
"partNumber"
).
nin
(
Arrays
.
asList
(
"CS"
,
"CM"
,
"CB"
))
/*.and("expireDate").lt(new Date())*/
);
Criteria
c
=
Criteria
.
where
(
"posName"
).
exists
(
true
).
ne
(
""
).
and
(
"partNumber"
).
nin
(
Arrays
.
asList
(
"CS"
,
"CM"
,
"CB"
));
//判断传入的类型
String
expireStatus
=
queryCondition
.
getExpireStatus
();
Date
startDate
,
endDate
;
if
(
"0"
.
equals
(
expireStatus
))
{
startDate
=
new
Date
();
endDate
=
DateUtil
.
offsetDay
(
startDate
,
7
);
c
.
and
(
"expireDate"
).
gte
(
startDate
).
lt
(
endDate
);
}
else
if
(
"1"
.
equals
(
expireStatus
))
{
startDate
=
DateUtil
.
offsetDay
(
new
Date
(),
7
);
endDate
=
DateUtil
.
offsetDay
(
new
Date
(),
30
);
c
.
and
(
"expireDate"
).
gte
(
startDate
).
lt
(
endDate
);
}
else
if
(
"2"
.
equals
(
expireStatus
))
{
List
<
Criteria
>
orCriList
=
new
ArrayList
<>();
orCriList
.
add
(
Criteria
.
where
(
"expireDate"
).
gt
(
new
Date
()).
and
(
"posName"
).
exists
(
true
).
ne
(
""
).
and
(
"partNumber"
).
nin
(
Arrays
.
asList
(
"CS"
,
"CM"
,
"CB"
)));
orCriList
.
add
(
Criteria
.
where
(
"expireDate"
).
exists
(
false
).
and
(
"posName"
).
exists
(
true
).
ne
(
""
).
and
(
"partNumber"
).
nin
(
Arrays
.
asList
(
"CS"
,
"CM"
,
"CB"
)));
c
.
orOperator
(
orCriList
);
}
else
if
(
"3"
.
equals
(
expireStatus
))
{
endDate
=
new
Date
();
c
.
and
(
"expireDate"
).
lt
(
endDate
);
}
query
.
addCriteria
(
c
);
FileUtil
.
downloadExcel
(
query
,
pageable
,
response
,
new
IExcelDownLoad
()
{
FileUtil
.
downloadExcel
(
query
,
pageable
,
response
,
new
IExcelDownLoad
()
{
@Override
@Override
...
@@ -882,13 +927,12 @@ public class OuterReportController {
...
@@ -882,13 +927,12 @@ public class OuterReportController {
header
.
add
(
Lists
.
newArrayList
(
"厂商代码"
));
header
.
add
(
Lists
.
newArrayList
(
"厂商代码"
));
header
.
add
(
Lists
.
newArrayList
(
"keeper"
));
header
.
add
(
Lists
.
newArrayList
(
"keeper"
));
header
.
add
(
Lists
.
newArrayList
(
"过期天数"
));
header
.
add
(
Lists
.
newArrayList
(
"过期天数"
));
header
.
add
(
Lists
.
newArrayList
(
"物料状态"
));
header
.
add
(
Lists
.
newArrayList
(
"过期日期"
));
header
.
add
(
Lists
.
newArrayList
(
"过期日期"
));
header
.
add
(
Lists
.
newArrayList
(
"工号"
));
header
.
add
(
Lists
.
newArrayList
(
"工号"
));
header
.
add
(
Lists
.
newArrayList
(
"首次入库时间"
));
header
.
add
(
Lists
.
newArrayList
(
"首次入库时间"
));
header
.
add
(
Lists
.
newArrayList
(
"当前入库时间"
));
header
.
add
(
Lists
.
newArrayList
(
"当前入库时间"
));
header
.
add
(
Lists
.
newArrayList
(
"来源"
));
header
.
add
(
Lists
.
newArrayList
(
"来源"
));
header
.
add
(
Lists
.
newArrayList
(
"
备注
"
));
header
.
add
(
Lists
.
newArrayList
(
"
物料状态
"
));
return
header
;
return
header
;
}
}
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/util/ExpireDateUtil.java
查看文件 @
d2d78fa
...
@@ -23,10 +23,10 @@ public class ExpireDateUtil {
...
@@ -23,10 +23,10 @@ public class ExpireDateUtil {
public
static
String
getReelStatus
(
long
days
)
{
public
static
String
getReelStatus
(
long
days
)
{
if
(
days
<=
0
&&
days
>
-
7
)
{
if
(
days
<=
0
&&
days
>
-
7
)
{
return
"0-7天过期
(未过期)
"
;
return
"0-7天过期"
;
}
}
if
(
days
>
-
30
&&
days
<=
-
7
)
{
if
(
days
>
-
30
&&
days
<=
-
7
)
{
return
"7-30天过期
(未过期)
"
;
return
"7-30天过期"
;
}
}
if
(
days
>
0
)
{
if
(
days
>
0
)
{
return
"已过期"
;
return
"已过期"
;
...
@@ -66,7 +66,7 @@ public class ExpireDateUtil {
...
@@ -66,7 +66,7 @@ public class ExpireDateUtil {
case
"MURATA"
:
case
"MURATA"
:
return
getYYWWDate
(
dateStr
);
return
getYYWWDate
(
dateStr
);
case
"JAE"
:
case
"JAE"
:
return
getYY
MM
Date
(
dateStr
);
return
getYY
WW
Date
(
dateStr
);
case
"UNISTEEL"
:
case
"UNISTEEL"
:
return
getYYMMDDDate
(
dateStr
);
return
getYYMMDDDate
(
dateStr
);
case
"PSM"
:
case
"PSM"
:
...
@@ -110,7 +110,11 @@ public class ExpireDateUtil {
...
@@ -110,7 +110,11 @@ public class ExpireDateUtil {
case
"KYOCERA"
:
case
"KYOCERA"
:
return
getYYWWDate
(
dateStr
);
return
getYYWWDate
(
dateStr
);
case
"TDK"
:
case
"TDK"
:
return
getYYWWDate
(
dateStr
);
if
(
dateStr
.
length
()
==
6
){
return
getYYMMDDDate
(
dateStr
);
}
else
{
return
getYYYYMMDDDate
(
dateStr
);
}
case
"INFINEON"
:
case
"INFINEON"
:
return
getYYWWDate
(
dateStr
);
return
getYYWWDate
(
dateStr
);
case
"EPSON"
:
case
"EPSON"
:
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论