Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit bc2cc4c3
由
hc
编写于
2024-07-05 14:05:51 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
fix:手动GR完成装箱并入库手动指定库位
1 个父辈
a64f9515
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
37 行增加
和
11 行删除
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualGrPutInController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualGrPutInController.java
查看文件 @
bc2cc4c
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
rawstor
.
controller
.
manual
;
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
rawstor
.
controller
.
manual
;
import
cn.hutool.core.util.ObjectUtil
;
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.DateUtil
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
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
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
...
@@ -28,7 +30,6 @@ import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BinCacheUtil;
...
@@ -28,7 +30,6 @@ import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BinCacheUtil;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil
;
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.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -199,15 +200,23 @@ public class ManualGrPutInController {
...
@@ -199,15 +200,23 @@ public class ManualGrPutInController {
@ApiOperation
(
"完成装箱并入库"
)
@ApiOperation
(
"完成装箱并入库"
)
@RequestMapping
(
"/boxToPos"
)
@RequestMapping
(
"/boxToPos"
)
@AnonymousAccess
@AnonymousAccess
public
synchronized
ResultBean
boxToPos
(
String
boxStr
)
{
public
synchronized
ResultBean
boxToPos
(
String
boxStr
,
String
posName
)
{
if
(
StringUtils
.
isEmpty
(
boxStr
))
{
if
(
StringUtils
.
isEmpty
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料箱信息"
});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料箱信息"
});
}
}
if
(
StringUtils
.
isEmpty
(
posName
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"库位信息"
});
}
//1.判断有没有正在执行的任务
//1.判断有没有正在执行的任务
List
<
DataLog
>
taskList
=
taskService
.
getAllTasks
();
List
<
DataLog
>
taskList
=
taskService
.
getAllTasks
();
for
(
DataLog
dataLog
:
taskList
)
{
for
(
DataLog
dataLog
:
taskList
)
{
if
(
posName
.
equals
(
dataLog
.
getPosName
()))
{
if
(!
dataLog
.
isFinished
()
&&
!
dataLog
.
isCancel
())
{
return
ResultBean
.
newErrorResult
(-
3
,
""
,
"当前库位有任务正在执行"
);
}
}
if
(
boxStr
.
startsWith
(
dataLog
.
getBarcode
()))
{
if
(
boxStr
.
startsWith
(
dataLog
.
getBarcode
()))
{
if
(!
dataLog
.
isFinished
()
&&
!
dataLog
.
isCancel
())
{
if
(!
dataLog
.
isFinished
()
&&
!
dataLog
.
isCancel
())
{
if
(
dataLog
.
isPutInTask
())
{
if
(
dataLog
.
isPutInTask
())
{
...
@@ -220,19 +229,36 @@ public class ManualGrPutInController {
...
@@ -220,19 +229,36 @@ public class ManualGrPutInController {
}
}
}
}
}
}
//2.判断库位是否存在
//2.获取空库位
StoragePos
newPos
=
storagePosManager
.
getByPosName
(
posName
);
Barcode
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
if
(
newPos
==
null
)
{
StoragePos
pos
=
BoxHandleUtil
.
locOnePos
(
boxBarcode
);
return
ResultBean
.
newErrorResult
(-
2
,
"smfcore.error.pos.notExist"
,
"[{0}]库位不存在"
,
new
String
[]{
posName
});
if
(
pos
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"未找到可用库位"
);
}
}
//3.库位是否存了料箱
if
(
ObjectUtil
.
isNotNull
(
newPos
.
getBarcode
())
&&
!
newPos
.
getBarcode
().
getBarcode
().
equals
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
4
,
"smfcore.error.pos.hasReel"
,
"库位[{0}]中已有物料,无法入库"
,
new
String
[]{
posName
});
}
Barcode
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
//4.生成入库任务
//4.生成入库任务
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
taskService
.
addTaskToFinished
(
newPos
,
boxBarcode
,
SecurityUtils
.
getLoginUsername
());
DataLog
dataLog
=
taskService
.
addPutInTaskToExecute
(
storage
,
boxBarcode
,
pos
,
TaskCurrentLoc
.
Manual_DischargeHole
);
return
ResultBean
.
newOkResult
(
"库位为:"
+
dataLog
.
getPosName
());
//将料箱原来的库位置空
String
oldPosName
=
boxBarcode
.
getPosName
();
StoragePos
oldPos
=
null
;
if
(
oldPosName
!=
null
)
{
oldPos
=
storagePosManager
.
getByPosName
(
oldPosName
);
}
if
(
oldPos
!=
null
)
{
// 原先已被存储在oldPos
oldPos
.
setBarcode
(
null
);
oldPos
.
setUsed
(
false
);
storagePosManager
.
save
(
oldPos
);
}
return
ResultBean
.
newOkResult
(
"ok"
);
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论