Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 37d6678e
由
hc
编写于
2024-07-23 21:28:29 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
fix:备品仓lizhen日志输出修改,bug修改
1 个父辈
643f239b
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
33 行增加
和
17 行删除
src/main/java/com/neotel/smfcore/core/barcode/service/manager/impl/BarcodeManagerImpl.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/api/LuxsanSpApi.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxPutInController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/CodeUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpBoxUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpareNoCache.java
src/main/java/com/neotel/smfcore/core/barcode/service/manager/impl/BarcodeManagerImpl.java
查看文件 @
37d6678
...
...
@@ -220,7 +220,7 @@ public class BarcodeManagerImpl implements IBarcodeManager {
}
protected
void
validateSave
(
Barcode
barcode
)
throws
ValidateException
{
barcode
.
setPartNumber
(
barcode
.
getPn
());
if
(
barcode
.
getBarcode
()==
null
)
{
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"barcode"
}
);
// throw new ValidateException("barcode.error.empty");
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/api/LuxsanSpApi.java
查看文件 @
37d6678
...
...
@@ -57,7 +57,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
String
url
=
GetReturnInventory
+
getQueryStr
(
request
);
// 发送GET请求并获取JSON格式的响应字符串
String
resJsonStr
=
HttpHelper
.
sendGet
(
url
);
log
.
info
(
"备品仓退库查询接口返回为:"
+
JSON
.
toJSONString
(
re
quest
));
log
.
info
(
"备品仓退库查询接口返回为:"
+
JSON
.
toJSONString
(
re
sJsonStr
));
// 将响应字符串解析为LizhenApiResult对象
LuxsanSpApiResult
lizhenApiResult
=
JSONObject
.
parseObject
(
resJsonStr
,
LuxsanSpApiResult
.
class
);
// 检查API调用是否成功,并返回结果对象
...
...
@@ -85,8 +85,8 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
try
{
log
.
info
(
"预约待领取接口请求为:"
+
request
);
String
url
=
GetUnclaimedUrl
+
getQueryStr
(
request
);
log
.
info
(
"预约待领取接口请求返回:"
+
JSON
.
toJSONString
(
request
));
String
resJsonStr
=
HttpHelper
.
sendGet
(
url
);
log
.
info
(
"预约待领取接口请求返回:"
+
JSON
.
toJSONString
(
resJsonStr
));
LuxsanSpApiResult
lizhenApiResult
=
JSONObject
.
parseObject
(
resJsonStr
,
LuxsanSpApiResult
.
class
);
if
(
lizhenApiResult
.
getCode
()
!=
200
)
{
throw
new
Exception
(
String
.
format
(
"预约待领取接口接口请求失败, 错误代码[%d],错误原因[%s]"
,
...
...
@@ -109,7 +109,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
try
{
log
.
info
(
"备品仓入库接口请求为:"
+
JSON
.
toJSONString
(
request
));
String
resJsonStr
=
HttpHelper
.
postJson
(
SpareInHourseUrl
,
request
);
log
.
info
(
"备品仓入库接口返回:"
+
JSON
.
toJSONString
(
re
quest
));
log
.
info
(
"备品仓入库接口返回:"
+
JSON
.
toJSONString
(
re
sJsonStr
));
LuxsanSpApiResult
lizhenApiResult
=
JSONObject
.
parseObject
(
resJsonStr
,
LuxsanSpApiResult
.
class
);
if
(
lizhenApiResult
.
getCode
()
!=
200
)
{
throw
new
ApiException
(
String
.
format
(
"备品仓入库接口请求失败, 错误代码[%d],错误原因[%s]"
,
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxPutInController.java
查看文件 @
37d6678
...
...
@@ -29,7 +29,11 @@ import com.neotel.smfcore.custom.luxsan_sp.util.*;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -44,6 +48,7 @@ import java.util.Map;
@RequestMapping
(
"/spBoxPutIn"
)
public
class
SpBoxPutInController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
SpBoxPutInController
.
class
);
@Autowired
private
CodeResolve
codeResolve
;
...
...
@@ -83,12 +88,12 @@ public class SpBoxPutInController {
}
String
currentRfid
=
station
.
getCurrentRfid
();
// currentRfid = "s1";
log
.
info
(
"getStationInfo工位上"
+
currentRfid
);
// currentRfid = "C0700377A";
if
(
StringUtils
.
isEmpty
(
currentRfid
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"当前工位上currentRfid为空"
);
}
// Barcode barcode = barcodeManager.findByBarcode("C0700084");
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
"=2x2="
+
currentRfid
);
if
(
barcode
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
currentRfid
+
"不是有效的条码"
);
...
...
@@ -113,11 +118,18 @@ public class SpBoxPutInController {
@RequestMapping
(
"/reelToBox"
)
@AnonymousAccess
public
synchronized
ResultBean
reelToBox
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
// SpareNo spareNo1 = spareNoCache.getExecutIngSpareNo();
// ReturnInventoryNo returnInventoryNo1 = returnNoCache.getExecutingOrderNo();
// if (ObjectUtil.isAllEmpty(spareNo1, returnInventoryNo1)) {
// return ResultBean.newErrorResult(-1,"","没有找到正在执行的入库单或者退库单");
// }
String
boxStr
=
paramMap
.
get
(
"boxStr"
);
String
codeStr
=
paramMap
.
get
(
"codeStr"
);
String
binCodeStr
=
paramMap
.
get
(
"binCodeStr"
);
// boxStr = "C0700377A";
// codeStr = "1950090020044V&&2";
// binCodeStr = "C0700377-01";
//解析料箱信息
Barcode
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
"=2x2="
+
boxStr
);
...
...
@@ -152,10 +164,10 @@ public class SpBoxPutInController {
//3.判断与当前隔口的料号是否匹配
String
binPartNumber
=
binBarcode
.
getPartNumber
();
if
(
binPartNumber
.
equals
(
"CS"
)
||
binPartNumber
.
equals
(
"CB"
)
||
binPartNumber
.
equals
(
"CM"
))
{
binPartNumber
=
""
;
}
//
String binPartNumber = binBarcode.getPartNumber();
//
if (binPartNumber.equals("CS") || binPartNumber.equals("CB") || binPartNumber.equals("CM")) {
//
binPartNumber = "";
//
}
boolean
isOk
=
false
;
String
codePartNumber
=
codeBarcode
.
getPartNumber
();
...
...
@@ -201,7 +213,7 @@ public class SpBoxPutInController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
codePartNumber
+
"没有入退库需求,请检查是否存在或者不符合入退库数量"
);
}
//
先调用入库接口
//
先调用入库接口
if
(
baseNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
SpareInHourseDetail
detail
=
new
SpareInHourseDetail
();
detail
.
setInQty
(
codeBarcode
.
getQty
());
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/CodeUtil.java
查看文件 @
37d6678
...
...
@@ -10,12 +10,12 @@ public class CodeUtil {
public
static
CodeBarcode
getCodeBarcode
(
String
codeStr
){
if
(!
codeStr
.
contains
(
"
&&
"
)){
if
(!
codeStr
.
contains
(
"
"
)){
return
null
;
}
try
{
String
[]
split
=
codeStr
.
split
(
"
&&
"
);
String
[]
split
=
codeStr
.
split
(
"
"
);
String
partNumber
=
split
[
0
];
int
qty
=
Integer
.
parseInt
(
split
[
1
]);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpBoxUtil.java
查看文件 @
37d6678
package
com
.
neotel
.
smfcore
.
custom
.
luxsan_sp
.
util
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
...
...
@@ -18,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -189,11 +191,13 @@ public class SpBoxUtil {
}
public
static
String
getPartNumber
(
List
<
Barcode
>
subCodeList
,
String
reelId
){
for
(
Barcode
barcode
:
subCodeList
)
{
}
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
()){
for
(
Barcode
barcode
:
subCodeList
)
{
if
(
reelId
.
replace
(
"0"
,
""
)
.
equals
(
barcode
.
getBarcode
().
replace
(
"0"
,
""
))){
return
barcode
.
getP
artNumber
();
return
barcode
.
getP
n
();
}
}
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpareNoCache.java
查看文件 @
37d6678
...
...
@@ -263,8 +263,8 @@ public class SpareNoCache {
emptyBox
=
emptyPos
.
getBarcode
();
if
(
emptyPos
!=
null
)
{
newPn
.
setBarcode
(
emptyBox
.
getBarcode
()
+
"-"
+
(
emptyBox
.
getSubCodeList
()
==
null
?
1
:
emptyBox
.
getSubCodeList
().
size
()));
newPn
=
barcodeManager
.
save
(
newPn
);
//
newPn = barcodeManager.saveBarcode(newPn);
//
newPn = barcodeManager.save(newPn);
newPn
=
barcodeManager
.
saveBarcode
(
newPn
);
List
<
Barcode
>
subL
=
emptyBox
.
getSubCodeList
();
if
(
subL
==
null
)
{
subL
=
new
ArrayList
<>();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论