Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit fc39d207
由
zshaohui
编写于
2022-09-21 09:05:19 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
mes对接问题修改
1 个父辈
810cb6cb
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
33 行增加
和
13 行删除
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialBoxController.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/custom/neotelApi/NeotelApi.java
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialBoxController.java
查看文件 @
fc39d20
...
...
@@ -3,6 +3,7 @@ package com.neotel.smfcore.core.storage.rest;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.core.barcode.bean.CodeBean
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.rest.bean.dto.BarcodeDto
;
...
...
@@ -58,6 +59,9 @@ public class MaterialBoxController {
@Autowired
private
DataCache
dataCache
;
@Autowired
protected
SmfApi
smfApi
;
@ApiOperation
(
"查询料盒信息"
)
@PostMapping
@PreAuthorize
(
"@el.check('materialBox')"
)
...
...
@@ -219,8 +223,10 @@ public class MaterialBoxController {
subBarcode
.
setHostBarcodeId
(
barcode
.
getId
());
subBarcode
.
setAmount
(
newCount
);
barcodeManager
.
saveBarcode
(
subBarcode
);
smfApi
.
canPutInAfterResolve
(
subBarcode
);
finishTask
(
barcode
,
opQty
,
currentTask
,
subBarcode
,
subBarcode
.
getAmount
());
log
.
info
(
"条码"
+
subBarcode
.
getBarcode
()
+
"["
+
subBarcode
.
getPartNumber
()
+
"]入库到料盒["
+
barcode
.
getBarcode
()
+
"]数量:"
+
barcode
.
getAmount
());
}
else
if
(
subBarcode
.
getHostBarcodeId
().
equals
(
barcode
.
getId
()))
{
int
qty
=
subBarcode
.
getAmount
();
//出库
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
fc39d20
...
...
@@ -949,5 +949,6 @@ public class TaskService {
public
void
moveTaskToFinished
(
DataLog
task
)
{
taskMap
.
remove
(
task
.
getId
());
theFinishedTaskMap
.
put
(
task
.
getId
(),
task
);
tiggerTaskChangeListener
(
task
);
}
}
src/main/java/com/neotel/smfcore/custom/neotelApi/NeotelApi.java
查看文件 @
fc39d20
...
...
@@ -4,8 +4,10 @@ import com.neotel.smfcore.common.exception.ValidateException;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.common.utils.HttpHelper
;
import
com.neotel.smfcore.common.utils.JsonUtil
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.api.bean.ApiResult
;
import
com.neotel.smfcore.core.api.listener.BaseSmfApiListener
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
...
...
@@ -19,6 +21,7 @@ import org.apache.logging.log4j.util.Strings;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.text.ParseException
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -50,12 +53,13 @@ public class NeotelApi extends BaseSmfApiListener {
if
(
barcode
!=
null
)
{
fullCode
=
barcode
.
getFullCode
();
}
int
type
=
getType
(
task
),
w
=
0
,
h
=
0
;
if
(
type
!=
2
)
{
w
=
task
.
getW
();
h
=
task
.
getH
();
}
paramMap
.
put
(
"type"
,
type
);
paramMap
.
put
(
"fullCode"
,
fullCode
);
paramMap
.
put
(
"w"
,
w
);
paramMap
.
put
(
"h"
,
h
);
...
...
@@ -94,6 +98,7 @@ public class NeotelApi extends BaseSmfApiListener {
w
=
task
.
getW
();
h
=
task
.
getH
();
}
paramMap
.
put
(
"type"
,
type
);
paramMap
.
put
(
"w"
,
w
);
paramMap
.
put
(
"h"
,
h
);
...
...
@@ -135,6 +140,10 @@ public class NeotelApi extends BaseSmfApiListener {
@Override
public
Barcode
canPutIn
(
String
inCheckUrl
,
Barcode
barcode
)
throws
ValidateException
{
log
.
info
(
"{}类型为:{}"
,
barcode
.
getBarcode
(),
barcode
.
getType
());
if
(
COMPONENT_TYPE
.
COMPONENT
!=
barcode
.
getType
()){
return
null
;
}
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"reelId"
,
barcode
.
getBarcode
());
paramMap
.
put
(
"fullCode"
,
barcode
.
getFullCode
());
...
...
@@ -169,9 +178,15 @@ public class NeotelApi extends BaseSmfApiListener {
}
String
produceDateStr
=
getData
(
dataMap
,
"produceDate"
);
if
(
Strings
.
isNotBlank
(
produceDateStr
))
{
Date
produceDate
=
DateUtil
.
toDate
(
produceDateStr
,
"yyyy-MM-dd HH:mm:ss"
);
barcode
.
setProduceDate
(
produceDate
);
try
{
if
(
Strings
.
isNotBlank
(
produceDateStr
))
{
Date
date
=
new
Date
(
produceDateStr
);
produceDateStr
=
DateUtil
.
toDateString
(
date
.
getTime
(),
"yyyy-MM-dd HH:mm:ss"
);
Date
produceDate
=
DateUtil
.
toDate
(
produceDateStr
,
"yyyy-MM-dd HH:mm:ss"
);
barcode
.
setProduceDate
(
produceDate
);
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
barcode
=
barcodeManager
.
saveBarcode
(
barcode
);
...
...
@@ -201,16 +216,14 @@ public class NeotelApi extends BaseSmfApiListener {
private
int
getType
(
DataLog
task
)
{
int
type
=
0
;
//根据cid查询物料信息,能够查到,则是物料放入料箱
Barcode
barcode
=
barcodeManager
.
findByPartNumber
(
task
.
getCid
());
if
(
barcode
!=
null
)
{
if
(
StringUtils
.
isBlank
(
task
.
getStorageId
()))
{
type
=
1
;
}
//判断料仓类型,是否料箱放入散料仓
Storage
storage
=
storageManager
.
findByCid
(
task
.
getStorageId
());
if
(
storage
!=
null
)
{
if
(
storage
.
isXLC
())
{
type
=
2
;
}
else
{
Storage
storage
=
dataCache
.
getStorageById
(
task
.
getStorageId
());
if
(
storage
!=
null
)
{
if
(
storage
.
isXLC
()
)
{
type
=
2
;
}
}
}
return
type
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论