Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit fe67051e
由
LN
编写于
2024-08-23 13:46:50 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
上传ng料时更新inlist对应的取消任务ngMSg. 点料接口返回点料次数。
1 个父辈
9b7c304a
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
119 行增加
和
62 行删除
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
src/main/java/com/neotel/smfcore/core/inList/service/po/InListItem.java
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronDeviceController.java
src/main/java/com/neotel/smfcore/custom/micron1053/loading/util/LoadingUtil.java
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
fe67051
...
...
@@ -733,16 +733,20 @@ public class DeviceController {
if
(
ObjectUtil
.
isEmpty
(
result
))
{
//点料已完成,等待获取库位号
loadingUtil
.
xRayEndUpdateItem
(
barcode
.
getBarcode
(),
qty
,
INITEM_STATUS
.
XRayEnd
);
return
ResultBean
.
newOkResult
(
qty
);
return
ResultBean
.
newOkResult
(
barcode
.
getXrayCount
()
);
}
else
{
loadingUtil
.
xRayEndUpdateItem
(
barcode
.
getBarcode
(),
qty
,
INITEM_STATUS
.
XRayFail
);
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
ResultBean
<
Object
>
resultBean
=
ResultBean
.
newErrorResult
(
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
resultBean
.
setData
(
barcode
.
getXrayCount
());
return
resultBean
;
}
}
catch
(
ApiException
api
)
{
loadingUtil
.
xRayEndUpdateItem
(
barcode
.
getBarcode
(),
qty
,
INITEM_STATUS
.
XRayFail
);
return
ResultBean
.
newErrorResult
(
1
,
api
.
getMsgKey
(),
api
.
getMessage
());
ResultBean
<
Object
>
resultBean
=
ResultBean
.
newErrorResult
(
1
,
api
.
getMsgKey
(),
api
.
getMessage
());
resultBean
.
setData
(
barcode
.
getXrayCount
());
return
resultBean
;
}
...
...
src/main/java/com/neotel/smfcore/core/inList/service/po/InListItem.java
查看文件 @
fe67051
...
...
@@ -103,6 +103,9 @@ public class InListItem extends BasePo implements Serializable {
||
state
.
equalsIgnoreCase
(
INITEM_STATUS
.
API001NG
)
||
state
.
equalsIgnoreCase
(
INITEM_STATUS
.
NG
);
}
public
boolean
isCancel
()
{
return
state
.
equalsIgnoreCase
(
INITEM_STATUS
.
Cancel
);
}
public
boolean
isSuccess
(){
return
state
.
equalsIgnoreCase
(
INITEM_STATUS
.
Success
)||
state
.
equalsIgnoreCase
(
INITEM_STATUS
.
PutIn
)||
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronDeviceController.java
查看文件 @
fe67051
...
...
@@ -147,6 +147,9 @@ public class MicronDeviceController {
log
.
info
(
"uploadNgReel : ["
+
info
.
getNgPos
()
+
"],barcode:["
+
info
.
getBarcode
()
+
"],posName:["
+
info
.
getPosName
()
+
"]type:["
+
info
.
getMType
()
+
"]inout:["
+
info
.
getType
()
+
"],msg["
+
info
.
getNgMsg
()
+
"]"
);
MicronDataCache
.
uploadNgReel
(
info
);
loadingUtil
.
updateNgReel
(
info
);
return
ResultBean
.
newOkResult
(
"ok"
);
}
...
...
@@ -334,65 +337,65 @@ public class MicronDeviceController {
// return ResultBean.newOkResult("");
// }
@ApiOperation
(
"X-Ray点料完成,更新数量 "
)
@PostMapping
(
value
=
"/updateReelQty"
)
@ResponseBody
@AnonymousAccess
public
ResultBean
updateReelQty
(
HttpServletRequest
request
)
{
String
barcodeStr
=
request
.
getParameter
(
"barcode"
).
toString
();
Integer
qty
=
Integer
.
parseInt
(
request
.
getParameter
(
"qty"
).
toString
());
log
.
info
(
"X-Ray点料完成:barcode="
+
barcodeStr
+
",qty="
+
qty
);
Collection
<
CodeBean
>
codeBeans
=
codeResolve
.
resolveCodeStr
(
barcodeStr
,
COMPONENT_TYPE
.
COMPONENT
);
Barcode
barcode
=
null
;
for
(
CodeBean
codeBean
:
codeBeans
)
{
if
(
codeBean
.
isValid
())
{
if
(
barcode
!=
null
)
{
String
msg
=
"获取尺寸时找到多个有效条码"
;
return
ResultBean
.
newErrorResult
(
105
,
"smfcore.getSize.error"
,
"获取"
+
barcodeStr
+
"尺寸失败:有多个条码"
);
}
else
{
barcode
=
codeBean
.
getBarcode
();
}
}
}
if
(
barcode
==
null
)
{
return
ResultBean
.
newErrorResult
(
105
,
"smfcore.getSize.error"
,
"获取"
+
barcodeStr
+
"尺寸失败:未找到有效条码"
);
}
//TODO 更改条码数量
int
oldQty
=
barcode
.
getAmount
();
barcode
.
setAmount
(
qty
);
barcode
.
setOriAmount
(
oldQty
);
barcode
.
setXrayCount
(
barcode
.
getXrayCount
()
+
1
);
barcodeManager
.
saveBarcode
(
barcode
);
log
.
info
(
"点料完成,更新条码["
+
barcode
.
getBarcode
()
+
"]数量=["
+
qty
+
"],旧数量["
+
oldQty
+
"]"
);
//处理入库单
InList
inList
=
loadingUtil
.
getInlist
();
if
(
inList
==
null
)
{
return
ResultBean
.
newOkResult
(
qty
);
}
try
{
//上传数量
String
result
=
MicronApi
.
Api008
(
barcode
.
getBarcode
(),
oldQty
,
qty
);
if
(
ObjectUtil
.
isEmpty
(
result
))
{
//点料已完成,等待获取库位号
loadingUtil
.
xRayEndUpdateItem
(
barcode
.
getBarcode
(),
qty
,
INITEM_STATUS
.
XRayEnd
);
return
ResultBean
.
newOkResult
(
qty
);
}
else
{
loadingUtil
.
xRayEndUpdateItem
(
barcode
.
getBarcode
(),
qty
,
INITEM_STATUS
.
XRayFail
);
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
}
catch
(
ApiException
api
)
{
loadingUtil
.
xRayEndUpdateItem
(
barcode
.
getBarcode
(),
qty
,
INITEM_STATUS
.
XRayFail
);
return
ResultBean
.
newErrorResult
(
1
,
api
.
getMsgKey
(),
api
.
getMessage
());
}
}
//
//
@ApiOperation("X-Ray点料完成,更新数量 ")
//
@PostMapping(value = "/updateReelQty")
//
@ResponseBody
//
@AnonymousAccess
//
public ResultBean updateReelQty(HttpServletRequest request) {
//
String barcodeStr = request.getParameter("barcode").toString();
//
Integer qty = Integer.parseInt(request.getParameter("qty").toString());
//
log.info("X-Ray点料完成:barcode=" + barcodeStr + ",qty=" + qty);
//
Collection<CodeBean> codeBeans = codeResolve.resolveCodeStr(barcodeStr, COMPONENT_TYPE.COMPONENT);
//
Barcode barcode = null;
//
for (CodeBean codeBean : codeBeans) {
//
if (codeBean.isValid()) {
//
if (barcode != null) {
//
String msg = "获取尺寸时找到多个有效条码";
//
//
return ResultBean.newErrorResult(105, "smfcore.getSize.error", "获取" + barcodeStr + "尺寸失败:有多个条码");
//
} else {
//
barcode = codeBean.getBarcode();
//
}
//
//
}
//
}
//
if (barcode == null) {
//
return ResultBean.newErrorResult(105, "smfcore.getSize.error", "获取" + barcodeStr + "尺寸失败:未找到有效条码");
//
}
//
//TODO 更改条码数量
//
int oldQty = barcode.getAmount();
//
barcode.setAmount(qty);
//
barcode.setOriAmount(oldQty);
//
barcode.setXrayCount(barcode.getXrayCount() + 1);
//
barcodeManager.saveBarcode(barcode);
//
log.info("点料完成,更新条码[" + barcode.getBarcode() + "]数量=[" + qty + "],旧数量[" + oldQty + "]");
//
//
//处理入库单
//
InList inList = loadingUtil.getInlist();
//
if (inList == null) {
//
return ResultBean.newOkResult(qty);
//
}
//
//
try {
//
//上传数量
//
String result = MicronApi.Api008(barcode.getBarcode(), oldQty, qty);
//
if (ObjectUtil.isEmpty(result)) {
//
//点料已完成,等待获取库位号
//
loadingUtil.xRayEndUpdateItem(barcode.getBarcode(), qty, INITEM_STATUS.XRayEnd);
//
return ResultBean.newOkResult(qty);
//
//
} else {
//
loadingUtil.xRayEndUpdateItem(barcode.getBarcode(), qty, INITEM_STATUS.XRayFail);
//
return ResultBean.newErrorResult(1, "smfcore.micron.operationFailure", "操作失败");
//
}
//
} catch (ApiException api) {
//
//
loadingUtil.xRayEndUpdateItem(barcode.getBarcode(), qty, INITEM_STATUS.XRayFail);
//
return ResultBean.newErrorResult(1, api.getMsgKey(),api.getMessage());
//
}
//
//
}
@ApiOperation
(
"RFID入库完成"
)
@PostMapping
(
value
=
"/rfidPutInEnd"
)
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/loading/util/LoadingUtil.java
查看文件 @
fe67051
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.inList.enums.INITEM.INITEM_STATUS
;
import
com.neotel.smfcore.core.inList.enums.INLIST_STATUS
;
...
...
@@ -16,6 +17,7 @@ import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.custom.micron1053.api.MicronApi
;
import
com.neotel.smfcore.custom.micron1053.bean.ML5NgReelInfo
;
import
com.neotel.smfcore.custom.micron1053.loading.Bean.LoadingInfo
;
import
com.neotel.smfcore.custom.micron1053.util.MicronDataCache
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -165,6 +167,51 @@ public class LoadingUtil {
}
protected
CodeResolve
codeResolve
;
public
Boolean
updateNgReel
(
ML5NgReelInfo
reelInfo
){
try
{
InList
inList
=
getInlist
();
if
(
inList
==
null
)
{
return
false
;
}
if
(
ObjectUtil
.
isEmpty
(
reelInfo
.
getBarcode
())||
ObjectUtil
.
isEmpty
(
reelInfo
.
getNgMsg
())){
return
false
;}
//如果条形码可以找到就更新
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
reelInfo
.
getBarcode
());
if
(
barcode
!=
null
){
boolean
update
=
false
;
List
<
InListItem
>
inListItems
=
new
ArrayList
<>();
for
(
InListItem
item
:
inList
.
getInListItems
())
{
if
(
item
.
getRi
().
equals
(
barcode
)&&
item
.
isCancel
())
{
if
(
ObjectUtil
.
isEmpty
(
item
.
getNgMsg
())
||
item
.
getNgMsg
().
contains
(
"canceled"
))
{
update
=
true
;
item
.
setNgMsg
(
reelInfo
.
getNgMsg
());
item
=
inListItemManager
.
save
(
item
);
log
.
info
(
" 更新入库单["
+
inList
.
getName
()
+
"]:条码 ["
+
item
.
getRi
()
+
"]库位["
+
item
.
getPosName
()
+
"]的 ngmsg="
+
reelInfo
.
getNgMsg
());
}
}
inListItems
.
add
(
item
);
}
if
(
update
)
{
inList
.
setInListItems
(
inListItems
);
inList
=
inListManager
.
save
(
inList
);
inListCache
.
addInListToMap
(
inList
);
}
return
true
;
}
}
catch
(
Exception
exception
){
log
.
error
(
"updateNgReel "
+
reelInfo
.
getBarcode
()+
", "
+
reelInfo
.
getNgMsg
()+
" error :"
,
exception
);
}
return
false
;
}
public
void
xRayEndUpdateItem
(
String
barcode
,
int
count
,
String
s
)
{
updateItemState
(
barcode
,
""
,
s
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论