Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit c9405e14
由
孙克
编写于
2024-05-07 15:27:49 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
原材料入库时,设备端使用接口判断料串的物料是否可以放入指定的格口
1 个父辈
18ea9e1c
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
155 行增加
和
78 行删除
src/main/java/com/neotel/smfcore/common/utils/DateUtil.java
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
修改记录.txt
src/main/java/com/neotel/smfcore/common/utils/DateUtil.java
查看文件 @
c9405e1
...
@@ -103,6 +103,17 @@ public class DateUtil {
...
@@ -103,6 +103,17 @@ public class DateUtil {
return
c
.
getTime
();
return
c
.
getTime
();
}
}
public
static
Date
getNoTimeDate
(
String
dateStr
){
try
{
Date
date
=
toDate
(
dateStr
,
"yyyy-MM-dd HH:mm:ss"
);
Calendar
c
=
noTimeCalendar
();
c
.
setTime
(
date
);
return
c
.
getTime
();
}
catch
(
Exception
e
){
return
null
;
}
}
private
static
Calendar
noTimeCalendar
(){
private
static
Calendar
noTimeCalendar
(){
Calendar
c
=
Calendar
.
getInstance
();
Calendar
c
=
Calendar
.
getInstance
();
c
.
set
(
Calendar
.
HOUR
,
0
);
c
.
set
(
Calendar
.
HOUR
,
0
);
...
...
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
查看文件 @
c9405e1
...
@@ -170,6 +170,39 @@ public class Barcode extends BasePo implements Serializable {
...
@@ -170,6 +170,39 @@ public class Barcode extends BasePo implements Serializable {
// * 料盒条码:料盒内所有物料条码,key=barcode
// * 料盒条码:料盒内所有物料条码,key=barcode
// */
// */
// private Map<String, Barcode> subCodeMap;
// private Map<String, Barcode> subCodeMap;
/**
* 额外的一些信息属性
*/
private
Map
<
String
,
String
>
extraDataMap
=
new
HashMap
<>();
/**
* 获取Barcode的一些额外属性
*/
public
String
getExtraData
(
String
key
){
if
(
extraDataMap
==
null
){
return
null
;
}
return
extraDataMap
.
get
(
key
);
}
/**
* 为Barcode添加一些额外的属性, 如果value为Null, 则表示删除该属性
* @param key
* @param value
*/
public
void
updateExtraData
(
String
key
,
String
value
){
if
(
extraDataMap
==
null
){
extraDataMap
=
new
HashMap
<>();
}
if
(
value
==
null
){
extraDataMap
.
remove
(
key
);
}
else
{
extraDataMap
.
put
(
key
,
value
);
}
}
/**
/**
* 料盒条码:料盒内所有物料条码
* 料盒条码:料盒内所有物料条码
*/
*/
...
...
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
查看文件 @
c9405e1
...
@@ -429,7 +429,7 @@ public class CodeResolve {
...
@@ -429,7 +429,7 @@ public class CodeResolve {
}
}
if
(
barcode
==
null
){
if
(
barcode
==
null
){
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"
{0}不是
有效的条码"
,
new
String
[]{
codeStr
});
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"
未找到
有效的条码"
,
new
String
[]{
codeStr
});
}
}
return
barcode
;
return
barcode
;
}
}
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
c9405e1
...
@@ -471,7 +471,7 @@ public class StoragePosController {
...
@@ -471,7 +471,7 @@ public class StoragePosController {
List
<
StoragePosDto
>
StoragePosDtos
=
storagePosMapper
.
toDto
(
pages
.
getContent
());
List
<
StoragePosDto
>
StoragePosDtos
=
storagePosMapper
.
toDto
(
pages
.
getContent
());
for
(
StoragePosDto
storagePosDto
:
StoragePosDtos
)
{
for
(
StoragePosDto
storagePosDto
:
StoragePosDtos
)
{
BarcodeDto
barcode
=
storagePosDto
.
getBarcode
();
BarcodeDto
barcode
=
storagePosDto
.
getBarcode
();
if
(
barcode
.
getPutInTime
()
==
-
1
){
if
(
barcode
!=
null
&&
barcode
.
getPutInTime
()
==
-
1
){
barcode
.
setFirstPutInDate
(
barcode
.
getCreateDate
());
barcode
.
setFirstPutInDate
(
barcode
.
getCreateDate
());
//storagePosDto.setBarcode(barcode);
//storagePosDto.setBarcode(barcode);
}
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
查看文件 @
c9405e1
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.core.api.SmfApi
;
...
@@ -125,9 +126,11 @@ public class CDeviceController {
...
@@ -125,9 +126,11 @@ public class CDeviceController {
//判断条码是否正常
//判断条码是否正常
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
codeStr
);
Barcode
barcode
=
null
;
if
(
barcode
==
null
)
{
try
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"物料条码无效"
);
barcode
=
codeResolve
.
resolveOneValideBarcode
(
codeStr
);
}
catch
(
ValidateException
ve
){
return
ResultBean
.
newErrorResult
(-
1
,
ve
.
getMsgKey
(),
ve
.
getDefaultMsg
());
}
}
...
@@ -174,40 +177,6 @@ public class CDeviceController {
...
@@ -174,40 +177,6 @@ public class CDeviceController {
}
}
if
(
boxBarcode
!=
null
){
if
(
boxBarcode
!=
null
){
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
Barcode
subCodeInBin
=
null
;
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
//找到料箱中该料格的第一个条码
for
(
Barcode
subCodeInBox
:
subCodeList
)
{
if
(
subCodeInBox
.
getPosName
().
equalsIgnoreCase
(
binCodeStr
)){
subCodeInBin
=
subCodeInBox
;
break
;
}
}
if
(
subCodeInBin
!=
null
){
String
partNumber
=
barcode
.
getPartNumber
();
String
provider
=
barcode
.
getProvider
();
String
warehouseCode
=
barcode
.
getWarehouseCode
();
if
(
partNumber
.
equals
(
subCodeInBin
.
getPartNumber
())
&&
provider
.
equals
(
subCodeInBin
.
getProvider
())
&&
subCodeInBin
.
getWarehouseCode
().
equals
(
warehouseCode
))
{
//判断GR信息是否相同
log
.
info
(
barcode
.
getBarcode
()+
"当前物料的来源是:"
+
soucre
+
",料格"
+
subCodeInBin
.
getBarcode
()+
"的来源是:"
+
subCodeInBin
.
getBarSource
());
if
(
StringUtils
.
isNotEmpty
(
soucre
)){
if
(!
soucre
.
equals
(
subCodeInBin
.
getBarSource
())){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
binCodeStr
+
"的来源是:"
+
subCodeInBin
.
getBarSource
()+
"与当前入库的来源:"
+
soucre
+
"不一致"
);
}
}
}
else
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料号:"
+
partNumber
+
",供应商:"
+
provider
+
",库别:"
+
warehouseCode
+
"与料格中的料号:"
+
subCodeInBin
.
getPartNumber
()
+
",供应商:"
+
subCodeInBin
.
getProvider
()
+
"库别:"
+
subCodeInBin
.
getWarehouseCode
()
+
"不一致"
);
}
}
}
//判断隔口是否可以放入
//判断隔口是否可以放入
if
(
BinCacheUtil
.
canPutInBinCode
(
binCodeStr
,
warhouseCode
))
{
if
(
BinCacheUtil
.
canPutInBinCode
(
binCodeStr
,
warhouseCode
))
{
if
(
MaterialUtil
.
bindGr
(
materialStr
)){
if
(
MaterialUtil
.
bindGr
(
materialStr
)){
...
@@ -218,6 +187,9 @@ public class CDeviceController {
...
@@ -218,6 +187,9 @@ public class CDeviceController {
barcode
.
getAmount
(),
barcode
.
getAmount
(),
binCodeStr
,
Arrays
.
asList
(
barcode
.
getFullCode
())
binCodeStr
,
Arrays
.
asList
(
barcode
.
getFullCode
())
));
));
//将GR日期设置为生产日期
Date
grDate
=
DateUtil
.
getNoTimeDate
(
bindGrInfo
.
getGrDate
());
barcode
.
setProduceDate
(
grDate
);
}
}
barcode
.
setPosName
(
binCodeStr
);
barcode
.
setPosName
(
binCodeStr
);
barcode
.
setWarehouseCode
(
warhouseCode
);
barcode
.
setWarehouseCode
(
warhouseCode
);
...
@@ -238,19 +210,20 @@ public class CDeviceController {
...
@@ -238,19 +210,20 @@ public class CDeviceController {
}
}
@ApiOperation
(
"
物料放入料格完成
"
)
@ApiOperation
(
"
料格已放满
"
)
@RequestMapping
(
"/finishPutInMaterialBin"
)
@RequestMapping
(
"/finishPutInMaterialBin"
)
@AnonymousAccess
@AnonymousAccess
public
ResultBean
finishPutInMaterialBin
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
public
ResultBean
finishPutInMaterialBin
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
binCode
=
paramMap
.
get
(
"binCode"
);
String
binCode
Str
=
paramMap
.
get
(
"binCode"
);
String
materialStr
=
paramMap
.
get
(
"materialStr"
);
String
materialStr
=
paramMap
.
get
(
"materialStr"
);
log
.
info
(
"料
箱或者料串已经放满,收到料格信息为"
+
binCode
+
",料串信息为:"
+
materialStr
);
log
.
info
(
"料
格已经放满,收到料格信息为"
+
binCodeStr
+
",料串信息为:"
+
materialStr
);
//Barcode barcode = codeResolve.resolveOneValideBarcode(binCode);
String
boxStr
=
BoxHandleUtil
.
getBoxStr
(
binCodeStr
);
//if (barcode == null) {
Barcode
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
// throw new ValidateException("smfcore.error.barcode.invalid", "{0}不是有效的条码", new String[]{binCode});
//该料格有出库时, 需要清理此字段
//}
boxBarcode
.
updateExtraData
(
binCodeStr
,
"FULL"
);
barcodeManager
.
saveBarcode
(
boxBarcode
);
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
@@ -435,6 +408,8 @@ public class CDeviceController {
...
@@ -435,6 +408,8 @@ public class CDeviceController {
dataLog
.
setPosName
(
boxStr
);
dataLog
.
setPosName
(
boxStr
);
taskService
.
updateFinishedTask
(
dataLog
);
taskService
.
updateFinishedTask
(
dataLog
);
//有出库,此料格就去除满格标志
boxBarcode
.
updateExtraData
(
subCode
.
getPosName
(),
null
);
boxBarcode
.
removeFromSubCodes
(
subCode
);
boxBarcode
.
removeFromSubCodes
(
subCode
);
barcodeManager
.
save
(
boxBarcode
);
barcodeManager
.
save
(
boxBarcode
);
if
(
inPos
!=
null
){
if
(
inPos
!=
null
){
...
@@ -538,9 +513,10 @@ public class CDeviceController {
...
@@ -538,9 +513,10 @@ public class CDeviceController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到"
+
boxStr
+
"的入库库位"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到"
+
boxStr
+
"的入库库位"
);
}
}
@ApiOperation
(
"
返回Barcode信息
"
)
@ApiOperation
(
"
不再使用
"
)
@RequestMapping
(
"/getBarcode"
)
@RequestMapping
(
"/getBarcode"
)
@AnonymousAccess
@AnonymousAccess
@Deprecated
public
Barcode
getBarcode
(
@RequestBody
Map
<
String
,
String
>
paramMap
){
public
Barcode
getBarcode
(
@RequestBody
Map
<
String
,
String
>
paramMap
){
String
codeStr
=
paramMap
.
get
(
"codeStr"
);
String
codeStr
=
paramMap
.
get
(
"codeStr"
);
//解析条码为barcode
//解析条码为barcode
...
@@ -551,6 +527,79 @@ public class CDeviceController {
...
@@ -551,6 +527,79 @@ public class CDeviceController {
return
barcode
;
return
barcode
;
}
}
@ApiOperation
(
"入料机构获取可用料格"
)
@RequestMapping
(
"/validBin"
)
@AnonymousAccess
public
ResultBean
validBin
(
@RequestBody
Map
<
String
,
String
>
paramMap
){
String
stackerId
=
paramMap
.
get
(
"stackerId"
);
String
binListStr
=
paramMap
.
get
(
"binList"
);
List
<
String
>
validBinList
=
new
ArrayList
<
String
>();
log
.
info
(
"入料机构获取料串["
+
stackerId
+
"]的可用料格["
+
binListStr
+
"]"
);
BindGrInfo
bindGrInfo
=
MaterialUtil
.
getBindGrInfo
(
stackerId
);
if
(
bindGrInfo
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
"error.nobind"
,
"料串["
+
stackerId
+
"]未绑定GR"
);
}
Barcode
stackerBarcode
=
new
Barcode
();
stackerBarcode
.
setBarcode
(
stackerId
);
stackerBarcode
.
setPartNumber
(
bindGrInfo
.
getMaterialCode
());
stackerBarcode
.
setProvider
(
bindGrInfo
.
getBrand
());
//将GR日期设置为生产日期
Date
grDate
=
DateUtil
.
getNoTimeDate
(
bindGrInfo
.
getGrDate
());
stackerBarcode
.
setProduceDate
(
grDate
);
String
[]
binList
=
binListStr
.
split
(
","
);
for
(
String
binId
:
binList
)
{
String
boxStr
=
BoxHandleUtil
.
getBoxStr
(
binId
);
Barcode
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
String
canPutIn
=
canMaterialPutInBin
(
stackerBarcode
,
boxBarcode
,
binId
);
if
(
canPutIn
.
isEmpty
()){
validBinList
.
add
(
binId
);
}
}
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"validBinList"
,
validBinList
);
return
ResultBean
.
newOkResult
(
dataMap
);
}
/**
* 验证物料是否可以放入料格:
* 1 料格未满 2 料格中若有物料,必须料号,供应商,库别,过账日期一致才可放入
* @return
*/
public
String
canMaterialPutInBin
(
Barcode
reelBarcode
,
Barcode
boxBarcode
,
String
binId
){
String
isBinFull
=
boxBarcode
.
getExtraData
(
binId
);
if
(
isBinFull
!=
null
){
//该料格已放满, 不可以再放料
return
"料格["
+
binId
+
"]已满,不可放入物料["
+
reelBarcode
.
getBarcode
()+
"]"
;
}
if
(
BinCacheUtil
.
canPutInBinCode
(
binId
,
reelBarcode
.
getWarehouseCode
()))
{
return
"库别["
+
reelBarcode
.
getWarehouseCode
()+
"]不可放入料格["
+
binId
+
"]"
;
}
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
if
(
subCodeList
!=
null
){
for
(
Barcode
barcode
:
subCodeList
)
{
if
(
barcode
.
getPosName
().
equals
(
binId
)){
//因为bin中的物料都是一样的料号,供应商,库别,过账日期,所以只需要找到Bin中的第一个物料进行比对就可以了
if
(!
barcode
.
getPartNumber
().
equals
(
reelBarcode
.
getPartNumber
())){
return
"料格中物料的料号["
+
barcode
.
getPartNumber
()+
"]与["
+
reelBarcode
.
getBarcode
()+
"]的料号["
+
reelBarcode
.
getPartNumber
()+
"]不一致"
;
}
if
(!
barcode
.
getProvider
().
equals
(
reelBarcode
.
getProvider
())){
return
"料格中物料的供应商["
+
barcode
.
getProvider
()+
"]与["
+
reelBarcode
.
getBarcode
()+
"]的供应商["
+
reelBarcode
.
getProvider
()+
"]不一致"
;
}
if
(!
barcode
.
getWarehouseCode
().
equals
(
reelBarcode
.
getWarehouseCode
())){
return
"料格中物料的库别["
+
barcode
.
getWarehouseCode
()+
"]与["
+
reelBarcode
.
getBarcode
()+
"]的库别["
+
reelBarcode
.
getWarehouseCode
()+
"]不一致"
;
}
if
(!
barcode
.
getProduceDate
().
equals
(
reelBarcode
.
getProduceDate
())){
return
"料格中物料的供应商["
+
barcode
.
getProvider
()+
"]与["
+
reelBarcode
.
getBarcode
()+
"]的供应商["
+
reelBarcode
.
getPartNumber
()+
"]不一致"
;
}
}
}
}
return
""
;
}
private
void
generatePutInTask
(
Barcode
barcode
,
Barcode
boxBarcode
)
{
private
void
generatePutInTask
(
Barcode
barcode
,
Barcode
boxBarcode
)
{
DataLog
dataLog
=
new
DataLog
();
DataLog
dataLog
=
new
DataLog
();
...
...
修改记录.txt
查看文件 @
c9405e1
20220225修改:
1.工单出库界面调整
2.增加:物料管理->物料入库菜 页面
3.增加:设置->料架设置 页面
20220228 增加接口:
1 入料机构获取可用料格
/service/store/cidIsExists
客户端判断CID是否存在,参数:cid,返回值code=0表示存在,其他值表示不存在
地址: /cdevice/validBin
>
/service/store/uploadStoragePos
>参数: {"stackerId":"B000009", binList:"C0700001-1,C0700001-2,C0700001-3"}
客户端上传料仓库位列表,参数:cid,posList (库位列表)
>> stackerId: 料串编号
处理:判断料仓是否存在,不存在时自动创建料仓。料仓无库位时自动上传库位,有库位时不处理。
>> binList: 料格列表, 多个料格用,分割
>
> 返回:
20220228:
>>` {"code":0,"msg":"ok","data":{"validBinList":["C0700001-1","C0700001-2"]}}`
1.菜单页面调整。
>>
2.库位页面调整。
>> - code: 0为正常,其他为异常(料串未绑定等), 注意, 没有可用的料格时, code为0, 不是异常
3.登录页面增加语言切换。
>> - msg:消息,
4.共享文件夹页面调整。
>> - data:
>> - validBinList: 可用的料格列表, 如果没有可用的料格, 那么列表为空
20220304:
个人中心增加进入调试模式功能。
20220307:
启用禁用库位增加操作日志。
20220314:
增加移动料架:NLM,入库时自动推荐库位,无合适库位时自动合并库位。
20220318:
安全库存和 呆滞物料功能
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论