Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6ce4c4f7
由
孙克
编写于
2024-05-09 15:37:50 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加原材料CTU获取入库/出库任务接口,接品描述详见修改记录
1 个父辈
2f07434e
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
185 行增加
和
8 行删除
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/WarehouseController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/bean/dto/CtuTask.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BoxHandleUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/LineController.java
修改记录.txt
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
查看文件 @
6ce4c4f
...
...
@@ -220,7 +220,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
}
//ReelLockPosUtil.removeReelLockPosInfo(barcodeSave.getBarcode());
return
taskService
.
addPutInTaskToExecute
(
storage
,
barcodeSave
,
storagePos
);
return
taskService
.
addPutInTaskToExecute
(
storage
,
barcodeSave
,
storagePos
,
""
);
}
}
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
6ce4c4f
...
...
@@ -111,11 +111,12 @@ public class TaskService {
/**
* 条码入库,加入要执行的任务
*/
public
synchronized
DataLog
addPutInTaskToExecute
(
Storage
storage
,
Barcode
barcode
,
StoragePos
storagePos
)
throws
ValidateException
{
public
synchronized
DataLog
addPutInTaskToExecute
(
Storage
storage
,
Barcode
barcode
,
StoragePos
storagePos
,
String
boxLoc
)
throws
ValidateException
{
DataLog
task
=
new
DataLog
(
storage
,
barcode
,
storagePos
);
task
.
setType
(
OP
.
PUT_IN
);
task
.
setStatus
(
OP_STATUS
.
WAIT
.
name
());
task
.
setLoc
(
boxLoc
);
if
(
barcode
!=
null
)
{
task
.
setWarehouseCode
(
barcode
.
getWarehouseCode
());
task
.
setDescribe
(
barcode
.
getDescribe
());
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/WarehouseController.java
查看文件 @
6ce4c4f
...
...
@@ -1418,7 +1418,8 @@ public class WarehouseController {
DataLog
task
=
null
;
if
(
pos
!=
null
)
{
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
task
=
generateTask
(
storage
,
pos
.
getBarcode
(),
pos
,
OP
.
CHECKOUT
,
OP_STATUS
.
WAIT
.
name
(),
name
,
ExtendType
.
STORAGE_CHECKOUT
);
String
toLoc
=
"In_FeedingInlet"
;
task
=
generateTask
(
storage
,
pos
.
getBarcode
(),
pos
,
OP
.
CHECKOUT
,
OP_STATUS
.
WAIT
.
name
(),
toLoc
,
ExtendType
.
STORAGE_CHECKOUT
);
}
return
task
;
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/bean/dto/CtuTask.java
0 → 100644
查看文件 @
6ce4c4f
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
rawstor
.
bean
.
dto
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @author sunke
* @date 2024/5/9 10:42
*/
@Data
public
class
CtuTask
{
private
String
id
;
/**
* 箱子号
*/
private
String
boxCode
;
/**
* 任务类型, 入库=1或出库=2
*/
private
int
taskType
;
/**
* 起点位置
* 料箱送到库位时,可能的值为In1_DischargeHole,In2_DischargeHole,Out1_DischargeHole,Out2_DischargeHole
* 料箱从库位取出时,值为库位号
*/
private
String
fromLoc
;
/**
* 目的地位置
* 料箱送到库位时, 值为库位号
* 料箱从库位取出时,可能的值为In1_FeedingInlet,In2_FeedingInlet,Out1_FeedingInlet,Out2_FeedingInlet,In_FeedingInlet(入料机构入料口,不指定哪个入料机构),Out_FeedingInlet(出料机构入料口,不指定哪个出料机构)
*/
private
String
toLoc
;
private
Date
createDate
;
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
查看文件 @
6ce4c4f
...
...
@@ -29,6 +29,7 @@ import com.neotel.smfcore.custom.luxsan.api.LuxsanApi;
import
com.neotel.smfcore.custom.luxsan.api.bean.request.NewLabelToCellRequest
;
import
com.neotel.smfcore.custom.luxsan.api.bean.request.PickingIssueRequest
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.BindGrInfo
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.CtuTask
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.LiteorderCheckType
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BinCacheUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil
;
...
...
@@ -39,6 +40,7 @@ import com.neotel.smfcore.security.annotation.AnonymousAccess;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.logging.log4j.util.Strings
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -247,12 +249,16 @@ public class CDeviceController {
@ApiOperation
(
"料箱入库,生成任务"
)
@RequestMapping
(
"/boxIntoPos"
)
@AnonymousAccess
public
synchronized
ResultBean
boxIntoPos
(
String
boxStr
)
{
log
.
info
(
"料箱入库开始生成任务:"
+
boxStr
);
public
synchronized
ResultBean
boxIntoPos
(
String
boxStr
,
String
boxLoc
)
{
log
.
info
(
"
["
+
boxLoc
+
"]位置的
料箱入库开始生成任务:"
+
boxStr
);
if
(
StringUtils
.
isEmpty
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料箱信息"
});
}
// if (StringUtils.isEmpty(boxLoc)) {
// return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "料箱位置参数boxLoc不能为空");
// }
//1.判断有没有正在执行的任务
List
<
DataLog
>
taskList
=
taskService
.
getAllTasks
();
for
(
DataLog
dataLog
:
taskList
)
{
...
...
@@ -279,7 +285,7 @@ public class CDeviceController {
//4.生成入库任务
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
DataLog
dataLog
=
taskService
.
addPutInTaskToExecute
(
storage
,
boxBarcode
,
pos
);
DataLog
dataLog
=
taskService
.
addPutInTaskToExecute
(
storage
,
boxBarcode
,
pos
,
boxLoc
);
return
ResultBean
.
newOkResult
(
dataLog
);
}
...
...
@@ -510,6 +516,53 @@ public class CDeviceController {
}
@ApiOperation
(
"原材料CTU获取线体到架子的入库任务(入满箱或出库后回库)"
)
@RequestMapping
(
"/lineToShelfTasks"
)
@AnonymousAccess
public
ResultBean
lineToShelfTasks
(){
List
<
DataLog
>
allTasks
=
taskService
.
getAllTasks
();
List
<
CtuTask
>
lineToShelfTaskList
=
new
ArrayList
<>();
for
(
DataLog
dataLog
:
allTasks
)
{
if
(
dataLog
.
isPutInTask
()
&&
dataLog
.
isWait
()){
CtuTask
ctuTask
=
new
CtuTask
();
ctuTask
.
setId
(
dataLog
.
getId
());
ctuTask
.
setTaskType
(
dataLog
.
getType
());
//起始点为线体传入的boxLoc值
ctuTask
.
setFromLoc
(
dataLog
.
getLoc
());
//目的地都为库位
ctuTask
.
setToLoc
(
dataLog
.
getPosName
());
ctuTask
.
setCreateDate
(
ctuTask
.
getCreateDate
());
lineToShelfTaskList
.
add
(
ctuTask
);
}
}
return
ResultBean
.
newOkResult
(
lineToShelfTaskList
);
}
@ApiOperation
(
"原材料CTU获取架子到线体的出库任务(出空箱到入料机构或出库到出料机构)"
)
@RequestMapping
(
"/shelfToLineTasks"
)
@AnonymousAccess
public
ResultBean
shelfToLineTasks
(){
List
<
DataLog
>
allTasks
=
taskService
.
getAllTasks
();
List
<
CtuTask
>
shelfToLineTaskList
=
new
ArrayList
<>();
for
(
DataLog
dataLog
:
allTasks
)
{
if
(
dataLog
.
isCheckOutTask
()
&&
dataLog
.
isWait
()){
CtuTask
ctuTask
=
new
CtuTask
();
ctuTask
.
setId
(
dataLog
.
getId
());
ctuTask
.
setTaskType
(
dataLog
.
getType
());
ctuTask
.
setFromLoc
(
dataLog
.
getPosName
());
//手动出空箱的目的地已经设置为In_FeedingInlet, 所以其他出库的未设置目的地的设置为Out_FeedingInlet
String
toLoc
=
dataLog
.
getLoc
();
if
(
Strings
.
isBlank
(
toLoc
)){
toLoc
=
"Out_FeedingInlet"
;
}
ctuTask
.
setToLoc
(
toLoc
);
ctuTask
.
setCreateDate
(
ctuTask
.
getCreateDate
());
shelfToLineTaskList
.
add
(
ctuTask
);
}
}
return
ResultBean
.
newOkResult
(
shelfToLineTaskList
);
}
@ApiOperation
(
"根据料箱获取目的地"
)
@RequestMapping
(
"/getTargetByBox"
)
@AnonymousAccess
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BoxHandleUtil.java
查看文件 @
6ce4c4f
...
...
@@ -78,7 +78,7 @@ public class BoxHandleUtil {
Barcode
barcode
=
storagePos
.
getBarcode
();
if
(
barcode
==
null
)
{
log
.
warn
(
"任务:"
+
opTask
.
getId
()
+
" 仓位:"
+
opTask
.
getPos
Id
()
+
" 的 Barcode 为null, 之前可能处理过,结束任务后直接返回"
);
log
.
warn
(
"任务:"
+
opTask
.
getId
()
+
" 仓位:"
+
opTask
.
getPos
Name
()
+
" 的 Barcode 为null, 之前可能处理过,结束任务后直接返回"
);
return
;
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/LineController.java
查看文件 @
6ce4c4f
...
...
@@ -202,8 +202,10 @@ public class LineController {
//清理扫描的cartonId
barcode
.
setScanCartonId
(
""
);
//4.生成入库任务
taskService
.
addPutInTaskToExecute
(
storage
,
barcode
,
pos
);
String
boxLoc
=
"semiFinished_In"
;
taskService
.
addPutInTaskToExecute
(
storage
,
barcode
,
pos
,
boxLoc
);
return
ResultBean
.
newOkResult
(
""
);
}
...
...
修改记录.txt
查看文件 @
6ce4c4f
...
...
@@ -14,3 +14,82 @@
>> - msg:消息,
>> - data:
>> - validBinList: 可用的料格列表, 如果没有可用的料格, 那么列表为空
20240509 原材料CTU接口
1 原材料CTU获取线体到架子的入库任务(入满箱或出库后回库)
地址: /cdevice/lineToShelfTasks
参数: 无
返回:
{
"code":0,
"msg":"ok",
"data":[
{
"id":"123451",
"boxCode":"C0700025",
"taskType": 1,
"fromLoc": "In1_DischargeHole"
"toLoc":"1-10"
"createDate":"2024-05-09 12:24:35"
},
{
"id":"123461",
"boxCode":"C0700023",
"taskType": 1,
"fromLoc": "Out2_DischargeHole"
"toLoc":"1-15"
"createDate":"2024-05-09 12:24:35"
}
]
}`
>> - code: 0为正常,其他为异常
>> - msg:消息,
>> - data:
>> - id: 任务标识
>> - boxCode: 料箱编号
>> - taskType: 任务类型, 入库=1或出库=2
>> - fromLoc: 起点位置,可能的值为 In1_DischargeHole,In2_DischargeHole,Out1_DischargeHole,Out2_DischargeHole
>> - toLoc: 目的地位置,值为库位号
>> - createDate: 任务创建时间
2 原材料CTU获取架子到线体的出库任务(出空箱到入料机构或出库到出料机构)
地址: /cdevice/shelfToLineTasks
参数: 无
返回:
{
"code":0,
"msg":"ok",
"data":[
{
"id":"12345",
"boxCode":"C0700024",
"taskType": 2,
"fromLoc": "1-1"
"toLoc":"In_FeedingInlet"
"createDate":"2024-05-09 12:24:35"
},
{
"id":"12346",
"boxCode":"C0700023",
"taskType": 2,
"fromLoc": "1-5"
"toLoc":"出料机构入料口"
"createDate":"2024-05-09 12:24:35"
}
]
}`
>> - code: 0为正常,其他为异常
>> - msg:消息,
>> - data:
>> - id: 任务标识
>> - boxCode: 料箱编号
>> - taskType: 任务类型, 入库=1或出库=2
>> - fromLoc: 起点位置,值为库位号
>> - toLoc: 目的地位置,可能的值为 In1_FeedingInlet,In2_FeedingInlet,Out1_FeedingInlet,Out2_FeedingInlet,In_FeedingInlet(入料机构入料口,不指定哪个入料机构),Out_FeedingInlet(出料机构入料口,不指定哪个出料机构)
>> - createDate: 任务创建时间
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论