Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit b50db589
由
hc
编写于
2024-07-26 09:18:25 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
fix:条码为零不再报错,条码唯一码适配两个空格和&&,出库单拉箱子需要当前格口中有相应数量的相应物料,物料出库展示详细箱子信息,入料和出料的保存放到接口的最后
1 个父辈
925fbf53
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
90 行增加
和
108 行删除
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/api/LuxsanSpApi.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpAgvDeviceClientController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxCheckOutController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxPutInController.java
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpUnclaimedController.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/core/device/handler/impl/BaseDeviceHandler.java
查看文件 @
b50db58
...
@@ -63,7 +63,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
...
@@ -63,7 +63,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
@Autowired
@Autowired
private
IHumitureManager
humitureManager
;
private
IHumitureManager
humitureManager
;
@Autowired
@Autowired
protected
IBarcodeManager
barcodeManager
;
protected
IBarcodeManager
barcodeManager
;
...
@@ -349,7 +349,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
...
@@ -349,7 +349,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
}
}
if
(
barcodeSave
.
getAmount
()
<=
0
)
{
if
(
barcodeSave
.
getAmount
()
<=
0
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.wrongQty"
,
"条码[{0}]对应的数量<=0为: {1}"
,
new
String
[]{
barcodeSave
.
getBarcode
(),
barcodeSave
.
getAmount
()
+
""
});
//
throw new ValidateException("smfcore.error.barcode.wrongQty", "条码[{0}]对应的数量<=0为: {1}" , new String[]{barcodeSave.getBarcode(), barcodeSave.getAmount() + ""});
}
}
// if(barcodeSave.getPlateSize() <=0 || barcodeSave.getHeight() <= 0){
// if(barcodeSave.getPlateSize() <=0 || barcodeSave.getHeight() <= 0){
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
查看文件 @
b50db58
...
@@ -124,7 +124,7 @@ public class NLPShelfHandler extends BaseDeviceHandler{
...
@@ -124,7 +124,7 @@ public class NLPShelfHandler extends BaseDeviceHandler{
}
}
if
(
barcode
.
getAmount
()
<=
0
)
{
if
(
barcode
.
getAmount
()
<=
0
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.wrongQty"
,
"条码[{0}]对应的数量<=0为: {1}"
,
new
String
[]{
barcode
.
getBarcode
(),
barcode
.
getAmount
()
+
""
});
//
throw new ValidateException("smfcore.error.barcode.wrongQty", "条码[{0}]对应的数量<=0为: {1}" , new String[]{barcode.getBarcode(), barcode.getAmount() + ""});
}
}
Date
expireDate
=
barcode
.
getExpireDate
();
Date
expireDate
=
barcode
.
getExpireDate
();
...
@@ -536,4 +536,4 @@ public class NLPShelfHandler extends BaseDeviceHandler{
...
@@ -536,4 +536,4 @@ public class NLPShelfHandler extends BaseDeviceHandler{
public
DeviceType
getDeviceType
()
{
public
DeviceType
getDeviceType
()
{
return
DeviceType
.
NLP
;
return
DeviceType
.
NLP
;
}
}
}
\ No newline at end of file
\ No newline at end of file
}
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
b50db58
...
@@ -1359,7 +1359,7 @@ public class LiteOrderCache {
...
@@ -1359,7 +1359,7 @@ public class LiteOrderCache {
}
}
public
synchronized
String
checkOutUnclaimed
(
LiteOrder
liteOrder
)
{
public
synchronized
String
checkOutUnclaimed
(
LiteOrder
liteOrder
)
throws
Exception
{
String
orderNo
=
liteOrder
.
getOrderNo
();
String
orderNo
=
liteOrder
.
getOrderNo
();
LiteOrder
cacheOrder
=
liteOrderMap
.
get
(
orderNo
);
LiteOrder
cacheOrder
=
liteOrderMap
.
get
(
orderNo
);
if
(
cacheOrder
==
null
)
{
if
(
cacheOrder
==
null
)
{
...
@@ -1392,7 +1392,7 @@ public class LiteOrderCache {
...
@@ -1392,7 +1392,7 @@ public class LiteOrderCache {
int
totalOutNum
=
item
.
getTotalOutNum
();
int
totalOutNum
=
item
.
getTotalOutNum
();
int
assignNum
=
0
;
int
assignNum
=
0
;
int
needOutNum
=
totalOutNum
-
need
Num
;
int
needOutNum
=
needNum
-
totalOut
Num
;
while
(
assignNum
<
needOutNum
)
{
while
(
assignNum
<
needOutNum
)
{
...
@@ -1407,7 +1407,7 @@ public class LiteOrderCache {
...
@@ -1407,7 +1407,7 @@ public class LiteOrderCache {
StoragePos
pos
=
storagePosManager
.
findPartNumberInStorages
(
storageIdList
,
pn
,
excludePosIds
,
checkOutType
,
""
);
StoragePos
pos
=
storagePosManager
.
findPartNumberInStorages
(
storageIdList
,
pn
,
excludePosIds
,
checkOutType
,
""
);
if
(
pos
==
null
)
{
if
(
pos
==
null
)
{
log
.
info
(
item
.
getPn
()
+
"未找到可用库位,跳过"
);
log
.
info
(
item
.
getPn
()
+
"未找到可用库位,跳过"
);
continue
;
break
;
}
}
//进行标记
//进行标记
...
@@ -1416,10 +1416,14 @@ public class LiteOrderCache {
...
@@ -1416,10 +1416,14 @@ public class LiteOrderCache {
List
<
Barcode
>
subCodeList
=
barcode
.
getSubCodeList
();
List
<
Barcode
>
subCodeList
=
barcode
.
getSubCodeList
();
for
(
Barcode
subCode
:
subCodeList
)
{
for
(
Barcode
subCode
:
subCodeList
)
{
if
(
pn
.
equals
(
subCode
.
getPartNumber
())){
if
(
pn
.
equals
(
subCode
.
getPartNumber
())){
// 数量不足
if
(
subCode
.
getAmount
()
<
needOutNum
)
{
throw
new
Exception
(
"库存不足"
);
}
subCode
.
setOut
(
true
);
subCode
.
setOut
(
true
);
subCode
.
setOrderItemId
(
item
.
getId
());
subCode
.
setOrderItemId
(
item
.
getId
());
subCode
.
setOrderId
(
cacheOrder
.
getId
());
subCode
.
setOrderId
(
cacheOrder
.
getId
());
barcodeManager
.
save
(
subCode
);
subCode
=
barcodeManager
.
save
(
subCode
);
barcode
.
updateSubCodes
(
subCode
);
barcode
.
updateSubCodes
(
subCode
);
barcodeManager
.
save
(
barcode
);
barcodeManager
.
save
(
barcode
);
...
@@ -1432,7 +1436,7 @@ public class LiteOrderCache {
...
@@ -1432,7 +1436,7 @@ public class LiteOrderCache {
if
(
hasSmpPn
){
if
(
hasSmpPn
){
boxCheckOutNum
=
boxCheckOutNum
+
1
;
boxCheckOutNum
=
boxCheckOutNum
+
1
;
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getId
());
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
get
Storage
Id
());
DataLog
dataLog
=
new
DataLog
(
storage
,
barcode
,
pos
);
DataLog
dataLog
=
new
DataLog
(
storage
,
barcode
,
pos
);
dataLog
.
setSourceId
(
cacheOrder
.
getId
());
dataLog
.
setSourceId
(
cacheOrder
.
getId
());
dataLog
.
setSourceName
(
cacheOrder
.
getOrderNo
());
dataLog
.
setSourceName
(
cacheOrder
.
getOrderNo
());
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
b50db58
...
@@ -105,73 +105,32 @@ public class TaskService {
...
@@ -105,73 +105,32 @@ public class TaskService {
* 条码入库,加入要执行的任务
* 条码入库,加入要执行的任务
*/
*/
public
synchronized
DataLog
addPutInTaskToExecute
(
Storage
storage
,
Barcode
barcode
,
StoragePos
storagePos
,
String
boxLoc
)
throws
ValidateException
{
public
synchronized
DataLog
addPutInTaskToExecute
(
Storage
storage
,
Barcode
barcode
,
StoragePos
storagePos
,
String
boxLoc
)
throws
ValidateException
{
log
.
info
(
"Entering addPutInTaskToExecute method"
);
DataLog
task
=
new
DataLog
(
storage
,
barcode
,
storagePos
);
DataLog
task
=
new
DataLog
(
storage
,
barcode
,
storagePos
);
log
.
info
(
"DataLog task created"
);
task
.
setType
(
OP
.
PUT_IN
);
task
.
setType
(
OP
.
PUT_IN
);
log
.
info
(
"Task type set to PUT_IN"
);
task
.
setStatus
(
OP_STATUS
.
WAIT
.
name
());
task
.
setStatus
(
OP_STATUS
.
WAIT
.
name
());
log
.
info
(
"Task status set to WAIT"
);
task
.
setLoc
(
boxLoc
);
task
.
setLoc
(
boxLoc
);
log
.
info
(
"Task location set to: "
+
boxLoc
);
if
(
barcode
!=
null
)
{
if
(
barcode
!=
null
)
{
task
.
setWarehouseCode
(
barcode
.
getWarehouseCode
());
task
.
setWarehouseCode
(
barcode
.
getWarehouseCode
());
log
.
info
(
"Warehouse code set to: "
+
barcode
.
getWarehouseCode
());
task
.
setDescribe
(
barcode
.
getDescribe
());
task
.
setDescribe
(
barcode
.
getDescribe
());
log
.
info
(
"Description set to: "
+
barcode
.
getDescribe
());
task
.
setBatchInfo
(
barcode
.
getBatch
());
task
.
setBatchInfo
(
barcode
.
getBatch
());
log
.
info
(
"Batch info set to: "
+
barcode
.
getBatch
());
task
.
setDateCode
(
barcode
.
getDateCode
());
task
.
setDateCode
(
barcode
.
getDateCode
());
log
.
info
(
"Date code set to: "
+
barcode
.
getDateCode
());
task
.
setProvider
(
barcode
.
getProvider
());
task
.
setProvider
(
barcode
.
getProvider
());
log
.
info
(
"Provider set to: "
+
barcode
.
getProvider
());
task
.
setProviderNumber
(
barcode
.
getProviderNumber
());
task
.
setProviderNumber
(
barcode
.
getProviderNumber
());
log
.
info
(
"Provider number set to: "
+
barcode
.
getProviderNumber
());
task
.
setKeeperCode
(
barcode
.
getKeeperCode
());
task
.
setKeeperCode
(
barcode
.
getKeeperCode
());
log
.
info
(
"Keeper code set to: "
+
barcode
.
getKeeperCode
());
task
.
setNum
(
barcode
.
getAmount
());
task
.
setNum
(
barcode
.
getAmount
());
log
.
info
(
"Amount set to: "
+
barcode
.
getAmount
());
barcode
.
setPutInTime
(
System
.
currentTimeMillis
());
barcode
.
setPutInTime
(
System
.
currentTimeMillis
());
log
.
info
(
"Put in time set"
);
barcode
.
updateSluggishTime
(
dataCache
.
getPNsluggishDay
(
barcode
.
getPartNumber
()));
barcode
.
updateSluggishTime
(
dataCache
.
getPNsluggishDay
(
barcode
.
getPartNumber
()));
log
.
info
(
"Sluggish time updated"
);
log
.
info
(
"任务生成准备完成"
);
barcodeManager
.
saveBarcode
(
barcode
);
barcodeManager
.
saveBarcode
(
barcode
);
log
.
info
(
"Barcode saved"
);
}
}
String
loginUser
=
DevicesStatusUtil
.
getLastOpUsername
(
storage
.
getCid
());
String
loginUser
=
DevicesStatusUtil
.
getLastOpUsername
(
storage
.
getCid
());
if
(
Strings
.
isNullOrEmpty
(
loginUser
))
{
if
(
Strings
.
isNullOrEmpty
(
loginUser
))
{
loginUser
=
SecurityUtils
.
getLoginUsername
();
loginUser
=
SecurityUtils
.
getLoginUsername
();
}
}
log
.
info
(
"Login user set to: "
+
loginUser
);
task
.
setOperator
(
loginUser
);
task
.
setOperator
(
loginUser
);
log
.
info
(
"Operator set to: "
+
loginUser
);
task
=
updateQueueTask
(
task
);
task
=
updateQueueTask
(
task
);
log
.
info
(
"Queue task updated"
);
log
.
info
(
"cid:["
+
storage
.
getCid
()
+
"] barcode:["
+
barcode
.
getBarcode
()
+
"] partNumber:["
+
task
.
getPartNumber
()
+
"]位置["
+
storagePos
.
getPosName
()
+
"]的入库操作成功加入队列"
);
log
.
info
(
"cid:["
+
storage
.
getCid
()
+
"] barcode:["
+
barcode
.
getBarcode
()
+
"] partNumber:["
+
task
.
getPartNumber
()
+
"]位置["
+
storagePos
.
getPosName
()
+
"]的入库操作成功加入队列"
);
log
.
info
(
"Exiting addPutInTaskToExecute method"
);
return
task
;
return
task
;
}
}
...
@@ -1016,7 +975,7 @@ public class TaskService {
...
@@ -1016,7 +975,7 @@ public class TaskService {
if
(!
barcodeSave
.
getBarcode
().
startsWith
(
"C07"
)
&&
!
barcodeSave
.
getBarcode
().
startsWith
(
"C13"
)
&&
!
barcodeSave
.
getBarcode
().
startsWith
(
"C15"
))
{
if
(!
barcodeSave
.
getBarcode
().
startsWith
(
"C07"
)
&&
!
barcodeSave
.
getBarcode
().
startsWith
(
"C13"
)
&&
!
barcodeSave
.
getBarcode
().
startsWith
(
"C15"
))
{
if
(
barcodeSave
.
getAmount
()
<=
0
)
{
if
(
barcodeSave
.
getAmount
()
<=
0
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.wrongQty"
,
"条码[{0}]对应的数量<=0为: {1}"
,
new
String
[]{
barcodeSave
.
getBarcode
(),
barcodeSave
.
getAmount
()
+
""
});
//
throw new ValidateException("smfcore.error.barcode.wrongQty", "条码[{0}]对应的数量<=0为: {1}", new String[]{barcodeSave.getBarcode(), barcodeSave.getAmount() + ""});
}
}
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/api/LuxsanSpApi.java
查看文件 @
b50db58
...
@@ -57,7 +57,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
...
@@ -57,7 +57,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
String
url
=
GetReturnInventory
+
getQueryStr
(
request
);
String
url
=
GetReturnInventory
+
getQueryStr
(
request
);
// 发送GET请求并获取JSON格式的响应字符串
// 发送GET请求并获取JSON格式的响应字符串
String
resJsonStr
=
HttpHelper
.
sendGet
(
url
);
String
resJsonStr
=
HttpHelper
.
sendGet
(
url
);
log
.
info
(
"备品仓退库查询接口返回为:"
+
JSON
.
toJSONString
(
resJsonStr
)
);
log
.
info
(
"备品仓退库查询接口返回为:"
+
resJsonStr
);
// 将响应字符串解析为LizhenApiResult对象
// 将响应字符串解析为LizhenApiResult对象
LuxsanSpApiResult
lizhenApiResult
=
JSONObject
.
parseObject
(
resJsonStr
,
LuxsanSpApiResult
.
class
);
LuxsanSpApiResult
lizhenApiResult
=
JSONObject
.
parseObject
(
resJsonStr
,
LuxsanSpApiResult
.
class
);
// 检查API调用是否成功,并返回结果对象
// 检查API调用是否成功,并返回结果对象
...
@@ -83,10 +83,10 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
...
@@ -83,10 +83,10 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
public
static
List
<
GetUnclaimedResult
>
getUnclaimedDetails
(
GetUnclaimedRequest
request
)
{
public
static
List
<
GetUnclaimedResult
>
getUnclaimedDetails
(
GetUnclaimedRequest
request
)
{
try
{
try
{
log
.
info
(
"预约待领取接口请求为:"
+
request
);
log
.
info
(
"预约待领取接口请求为:"
+
JSON
.
toJSONString
(
request
)
);
String
url
=
GetUnclaimedUrl
+
getQueryStr
(
request
);
String
url
=
GetUnclaimedUrl
+
getQueryStr
(
request
);
String
resJsonStr
=
HttpHelper
.
sendGet
(
url
);
String
resJsonStr
=
HttpHelper
.
sendGet
(
url
);
log
.
info
(
"预约待领取接口请求返回:"
+
JSON
.
toJSONString
(
resJsonStr
)
);
log
.
info
(
"预约待领取接口请求返回:"
+
resJsonStr
);
LuxsanSpApiResult
lizhenApiResult
=
JSONObject
.
parseObject
(
resJsonStr
,
LuxsanSpApiResult
.
class
);
LuxsanSpApiResult
lizhenApiResult
=
JSONObject
.
parseObject
(
resJsonStr
,
LuxsanSpApiResult
.
class
);
if
(
lizhenApiResult
.
getCode
()
!=
200
)
{
if
(
lizhenApiResult
.
getCode
()
!=
200
)
{
throw
new
Exception
(
String
.
format
(
"预约待领取接口接口请求失败, 错误代码[%d],错误原因[%s]"
,
throw
new
Exception
(
String
.
format
(
"预约待领取接口接口请求失败, 错误代码[%d],错误原因[%s]"
,
...
@@ -109,7 +109,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
...
@@ -109,7 +109,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
try
{
try
{
log
.
info
(
"备品仓入库接口请求为:"
+
JSON
.
toJSONString
(
request
));
log
.
info
(
"备品仓入库接口请求为:"
+
JSON
.
toJSONString
(
request
));
String
resJsonStr
=
HttpHelper
.
postJson
(
SpareInHourseUrl
,
request
);
String
resJsonStr
=
HttpHelper
.
postJson
(
SpareInHourseUrl
,
request
);
log
.
info
(
"备品仓入库接口返回:"
+
JSON
.
toJSONString
(
resJsonStr
)
);
log
.
info
(
"备品仓入库接口返回:"
+
resJsonStr
);
LuxsanSpApiResult
lizhenApiResult
=
JSONObject
.
parseObject
(
resJsonStr
,
LuxsanSpApiResult
.
class
);
LuxsanSpApiResult
lizhenApiResult
=
JSONObject
.
parseObject
(
resJsonStr
,
LuxsanSpApiResult
.
class
);
if
(
lizhenApiResult
.
getCode
()
!=
200
)
{
if
(
lizhenApiResult
.
getCode
()
!=
200
)
{
throw
new
ApiException
(
String
.
format
(
"备品仓入库接口请求失败, 错误代码[%d],错误原因[%s]"
,
throw
new
ApiException
(
String
.
format
(
"备品仓入库接口请求失败, 错误代码[%d],错误原因[%s]"
,
...
@@ -128,6 +128,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
...
@@ -128,6 +128,7 @@ public class LuxsanSpApi extends DefaultSmfApiListener {
String
url
=
GetSpareNoUrl
+
getQueryStr
(
request
);
String
url
=
GetSpareNoUrl
+
getQueryStr
(
request
);
log
.
info
(
"获取入库单号请求为:"
+
request
);
log
.
info
(
"获取入库单号请求为:"
+
request
);
String
resJsonStr
=
HttpHelper
.
sendGet
(
url
);
String
resJsonStr
=
HttpHelper
.
sendGet
(
url
);
// String resJsonStr = HttpHelper.sendGet(url);
log
.
info
(
"获取入库单号返回:"
+
resJsonStr
);
log
.
info
(
"获取入库单号返回:"
+
resJsonStr
);
LuxsanSpApiResult
lizhenApiResult
=
JSONObject
.
parseObject
(
resJsonStr
,
LuxsanSpApiResult
.
class
);
LuxsanSpApiResult
lizhenApiResult
=
JSONObject
.
parseObject
(
resJsonStr
,
LuxsanSpApiResult
.
class
);
if
(
lizhenApiResult
.
getCode
()
!=
200
)
{
if
(
lizhenApiResult
.
getCode
()
!=
200
)
{
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpAgvDeviceClientController.java
查看文件 @
b50db58
...
@@ -208,7 +208,6 @@ public class SpAgvDeviceClientController {
...
@@ -208,7 +208,6 @@ public class SpAgvDeviceClientController {
String
rfid
=
request
.
getParameter
(
"barcode"
);
String
rfid
=
request
.
getParameter
(
"barcode"
);
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
"=2x2="
+
rfid
);
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
"=2x2="
+
rfid
);
log
.
info
(
"getTarget"
+
JSON
.
toJSONString
(
barcode
));
if
(
barcode
!=
null
){
if
(
barcode
!=
null
){
barcode
.
setAmount
(
1
);
barcode
.
setAmount
(
1
);
barcodeManager
.
save
(
barcode
);
barcodeManager
.
save
(
barcode
);
...
@@ -224,27 +223,20 @@ public class SpAgvDeviceClientController {
...
@@ -224,27 +223,20 @@ public class SpAgvDeviceClientController {
if
(
task
.
getBarcode
().
equals
(
barcode
.
getBarcode
()))
{
if
(
task
.
getBarcode
().
equals
(
barcode
.
getBarcode
()))
{
taskData
.
put
(
"barcode"
,
barcode
.
getBarcode
());
taskData
.
put
(
"barcode"
,
barcode
.
getBarcode
());
taskData
.
put
(
"slotCode"
,
task
.
getPosName
());
taskData
.
put
(
"slotCode"
,
task
.
getPosName
());
log
.
info
(
barcode
+
"已有任务"
);
return
ResultBean
.
newOkResult
(
taskData
);
return
ResultBean
.
newOkResult
(
taskData
);
}
}
}
}
}
}
log
.
info
(
"getTarget"
+
request
.
getParameter
(
"barcode"
)+
"没有正在执行的任务"
);
StoragePos
pos
=
SpBoxUtil
.
locOnePos
(
barcode
);
StoragePos
pos
=
SpBoxUtil
.
locOnePos
(
barcode
);
log
.
info
(
"getTarget"
+
request
.
getParameter
(
"barcode定位后的信息"
)+
JSON
.
toJSONString
(
pos
));
if
(
pos
!=
null
){
if
(
pos
!=
null
){
log
.
info
(
"开始生成新任务"
);
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
log
.
info
(
"库位信息"
+
JSON
.
toJSONString
(
storage
));
taskService
.
addPutInTaskToExecute
(
storage
,
barcode
,
pos
,
""
);
taskService
.
addPutInTaskToExecute
(
storage
,
barcode
,
pos
,
""
);
log
.
info
(
"生成完成"
);
taskData
.
put
(
"barcode"
,
barcode
.
getBarcode
());
taskData
.
put
(
"barcode"
,
barcode
.
getBarcode
());
taskData
.
put
(
"slotCode"
,
pos
.
getPosName
());
taskData
.
put
(
"slotCode"
,
pos
.
getPosName
());
}
}
}
}
log
.
info
(
barcode
.
getBarcode
()+
"生成ctu的任务信息"
+
JSON
.
toJSONString
(
taskData
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
log
.
info
(
e
.
getMessage
());
log
.
info
(
e
.
getMessage
());
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxCheckOutController.java
查看文件 @
b50db58
...
@@ -134,11 +134,10 @@ public class SpBoxCheckOutController {
...
@@ -134,11 +134,10 @@ public class SpBoxCheckOutController {
}
}
//4.开始
放入
料箱
//4.开始
拿出
料箱
binBarcode
.
setAmount
(
binBarcode
.
getAmount
()-
codeBarcode
.
getQty
());
binBarcode
.
setAmount
(
binBarcode
.
getAmount
()-
codeBarcode
.
getQty
());
boxBarcode
.
updateSubCodes
(
binBarcode
);
boxBarcode
.
updateSubCodes
(
binBarcode
);
barcodeManager
.
save
(
boxBarcode
);
//5.寻找空库位
//5.寻找空库位
StoragePos
pos
=
SpBoxUtil
.
locOnePos
(
boxBarcode
);
StoragePos
pos
=
SpBoxUtil
.
locOnePos
(
boxBarcode
);
...
@@ -159,6 +158,7 @@ public class SpBoxCheckOutController {
...
@@ -159,6 +158,7 @@ public class SpBoxCheckOutController {
pos
.
setBarcode
(
boxBarcode
);
pos
.
setBarcode
(
boxBarcode
);
pos
.
setUsed
(
true
);
pos
.
setUsed
(
true
);
storagePosManager
.
save
(
pos
);
storagePosManager
.
save
(
pos
);
barcodeManager
.
save
(
boxBarcode
);
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
@@ -169,9 +169,12 @@ public class SpBoxCheckOutController {
...
@@ -169,9 +169,12 @@ public class SpBoxCheckOutController {
List
<
LiteOrderItem
>
orderItemList
=
liteOrder
.
getOrderItems
();
List
<
LiteOrderItem
>
orderItemList
=
liteOrder
.
getOrderItems
();
for
(
LiteOrderItem
item
:
orderItemList
)
{
for
(
LiteOrderItem
item
:
orderItemList
)
{
if
(
item
.
getId
().
equals
(
orderItemId
))
{
if
(
item
.
getId
().
equals
(
orderItemId
))
{
if
(
item
.
get
TotalOutNum
()
-
item
.
getNeed
Num
()
<=
0
)
{
if
(
item
.
get
NeedNum
()
-
item
.
getTotalOut
Num
()
<=
0
)
{
return
liteOrder
.
getOrderNo
()
+
"预约单中:"
+
item
.
getPn
()
+
"已经出库完成,不允许出库"
;
return
liteOrder
.
getOrderNo
()
+
"预约单中:"
+
item
.
getPn
()
+
"已经出库完成,不允许出库"
;
}
}
if
((
item
.
getTotalOutNum
()
+
amount
)
>
item
.
getNeedNum
())
{
return
liteOrder
.
getOrderNo
()
+
"预约单中:"
+
item
.
getPn
()
+
"超出总需求数量,不允许出库"
;
}
int
totalOutNum
=
item
.
getTotalOutNum
();
int
totalOutNum
=
item
.
getTotalOutNum
();
item
.
setTotalOutNum
(
totalOutNum
+
amount
);
item
.
setTotalOutNum
(
totalOutNum
+
amount
);
liteOrderItemManager
.
save
(
item
);
liteOrderItemManager
.
save
(
item
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpBoxPutInController.java
查看文件 @
b50db58
package
com
.
neotel
.
smfcore
.
custom
.
luxsan_sp
.
controller
;
package
com
.
neotel
.
smfcore
.
custom
.
luxsan_sp
.
controller
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
...
@@ -209,7 +210,7 @@ public class SpBoxPutInController {
...
@@ -209,7 +210,7 @@ public class SpBoxPutInController {
//数量加
1
//数量加
spareNoDetail
.
setAlrInQty
(
spareNoDetail
.
getAlrInQty
()+
codeBarcode
.
getQty
());
spareNoDetail
.
setAlrInQty
(
spareNoDetail
.
getAlrInQty
()+
codeBarcode
.
getQty
());
baseNo
.
updateDetailList
(
spareNoDetail
);
baseNo
.
updateDetailList
(
spareNoDetail
);
...
@@ -223,30 +224,7 @@ public class SpBoxPutInController {
...
@@ -223,30 +224,7 @@ public class SpBoxPutInController {
log
.
info
(
"入料noDetail.getInQty()"
+
noDetail
.
getInQty
()+
"noDetail.getAlrInQty()"
+
noDetail
.
getAlrInQty
());
log
.
info
(
"入料noDetail.getInQty()"
+
noDetail
.
getInQty
()+
"noDetail.getAlrInQty()"
+
noDetail
.
getAlrInQty
());
}
}
if
(
finish
){
// 调用入库接口
if
(
baseNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
List
<
SpareInHourseDetail
>
details
=
new
ArrayList
<>();
for
(
SpareNoDetail
detail
:
baseNo
.
getDetailList
())
{
SpareInHourseDetail
spareInHourseDetail
=
new
SpareInHourseDetail
();
spareInHourseDetail
.
setInQty
(
detail
.
getInQty
());
spareInHourseDetail
.
setPartno
(
detail
.
getPartno
());
String
location
=
SpareNostatus
.
LOCATION_CODE
.
get
(
baseNo
.
getWhCode
());
spareInHourseDetail
.
setLocationCode
(
location
);
// spareInHourseDetail.setLocationCode(binBarcode.getBarcode());
details
.
add
(
spareInHourseDetail
);
}
LuxsanSpApi
.
spareInHourse
(
new
SpareInHourseRequest
(
baseNo
.
getDeptId
(),
baseNo
.
getNo
(),
baseNo
.
getWhCode
(),
details
));
}
}
if
(
baseNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
spareNoCache
.
addToMap
(
spareNo
);
spareNoManager
.
save
(
spareNo
);
}
else
{
returnNoCache
.
addToMap
(
returnInventoryNo
);
returnNoManager
.
save
(
returnInventoryNo
);
}
}
}
...
@@ -254,11 +232,9 @@ public class SpBoxPutInController {
...
@@ -254,11 +232,9 @@ public class SpBoxPutInController {
binBarcode
.
setPartNumber
(
codePartNumber
);
binBarcode
.
setPartNumber
(
codePartNumber
);
binBarcode
.
setAmount
(
binBarcode
.
getAmount
()+
codeBarcode
.
getQty
());
binBarcode
.
setAmount
(
binBarcode
.
getAmount
()+
codeBarcode
.
getQty
());
barcodeManager
.
save
(
binBarcode
);
boxBarcode
.
updateSubCodes
(
binBarcode
);
boxBarcode
.
updateSubCodes
(
binBarcode
);
barcodeManager
.
save
(
boxBarcode
);
// if (!finish) {
// if (!finish) {
// return ResultBean.newOkResult("");
// return ResultBean.newOkResult("");
...
@@ -277,11 +253,38 @@ public class SpBoxPutInController {
...
@@ -277,11 +253,38 @@ public class SpBoxPutInController {
dataLog
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
dataLog
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
dataLog
.
setPosName
(
binBarcode
.
getBarcode
());
dataLog
.
setPosName
(
binBarcode
.
getBarcode
());
dataLog
.
setType
(
OP
.
PUT_IN
);
dataLog
.
setType
(
OP
.
PUT_IN
);
taskService
.
updateFinishedTask
(
dataLog
);
pos
.
setBarcode
(
boxBarcode
);
pos
.
setBarcode
(
boxBarcode
);
pos
.
setUsed
(
true
);
pos
.
setUsed
(
true
);
if
(
finish
){
// 调用入库接口
if
(
baseNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
List
<
SpareInHourseDetail
>
details
=
new
ArrayList
<>();
for
(
SpareNoDetail
detail
:
baseNo
.
getDetailList
())
{
SpareInHourseDetail
spareInHourseDetail
=
new
SpareInHourseDetail
();
spareInHourseDetail
.
setInQty
(
detail
.
getInQty
());
spareInHourseDetail
.
setPartno
(
detail
.
getPartno
());
String
location
=
boxStr
;
// String location = SpareNostatus.LOCATION_CODE.get(baseNo.getWhCode());
spareInHourseDetail
.
setLocationCode
(
location
);
// spareInHourseDetail.setLocationCode(binBarcode.getBarcode());
details
.
add
(
spareInHourseDetail
);
}
LuxsanSpApi
.
spareInHourse
(
new
SpareInHourseRequest
(
baseNo
.
getDeptId
(),
baseNo
.
getNo
(),
baseNo
.
getWhCode
(),
details
));
}
}
if
(
baseNo
.
getClass
().
equals
(
SpareNo
.
class
))
{
spareNoCache
.
addToMap
(
spareNo
);
spareNoManager
.
save
(
spareNo
);
}
else
{
returnNoCache
.
addToMap
(
returnInventoryNo
);
returnNoManager
.
save
(
returnInventoryNo
);
}
storagePosManager
.
save
(
pos
);
storagePosManager
.
save
(
pos
);
barcodeManager
.
save
(
binBarcode
);
barcodeManager
.
save
(
boxBarcode
);
taskService
.
updateFinishedTask
(
dataLog
);
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/controller/SpUnclaimedController.java
查看文件 @
b50db58
...
@@ -120,7 +120,7 @@ public class SpUnclaimedController {
...
@@ -120,7 +120,7 @@ public class SpUnclaimedController {
@ApiOperation
(
"选中出库单"
)
@ApiOperation
(
"选中出库单"
)
@RequestMapping
(
"/checkOrderNo"
)
@RequestMapping
(
"/checkOrderNo"
)
@AnonymousAccess
@AnonymousAccess
public
ResultBean
checkOrderNo
(
String
orderNoStr
)
{
public
ResultBean
checkOrderNo
(
String
orderNoStr
)
throws
Exception
{
//判断有没有正在执行的任务单
//判断有没有正在执行的任务单
String
no
=
liteOrderCache
.
hasExecutingOrder
();
String
no
=
liteOrderCache
.
hasExecutingOrder
();
if
(
StringUtils
.
isNotEmpty
(
no
))
{
if
(
StringUtils
.
isNotEmpty
(
no
))
{
...
...
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/CodeUtil.java
查看文件 @
b50db58
...
@@ -10,12 +10,15 @@ public class CodeUtil {
...
@@ -10,12 +10,15 @@ public class CodeUtil {
public
static
CodeBarcode
getCodeBarcode
(
String
codeStr
){
public
static
CodeBarcode
getCodeBarcode
(
String
codeStr
){
if
(!
codeStr
.
contains
(
" "
)){
if
(!
(
codeStr
.
contains
(
" "
)
||
codeStr
.
contains
(
"&&"
)
)){
return
null
;
return
null
;
}
}
try
{
try
{
String
[]
split
=
codeStr
.
split
(
" "
);
String
[]
split
=
codeStr
.
split
(
" "
);
if
(
split
.
length
!=
2
)
{
split
=
codeStr
.
split
(
"&&"
);
}
String
partNumber
=
split
[
0
];
String
partNumber
=
split
[
0
];
int
qty
=
Integer
.
parseInt
(
split
[
1
]);
int
qty
=
Integer
.
parseInt
(
split
[
1
]);
...
@@ -32,5 +35,9 @@ public class CodeUtil {
...
@@ -32,5 +35,9 @@ public class CodeUtil {
return
null
;
return
null
;
}
}
public
static
void
main
(
String
[]
args
)
{
CodeBarcode
codeBarcode
=
getCodeBarcode
(
"sss&&1"
);
System
.
out
.
println
(
codeBarcode
);
}
}
}
src/main/java/com/neotel/smfcore/custom/luxsan_sp/util/SpBoxUtil.java
查看文件 @
b50db58
...
@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
...
@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -83,23 +84,34 @@ public class SpBoxUtil {
...
@@ -83,23 +84,34 @@ public class SpBoxUtil {
if
(
type
==
1
)
{
if
(
type
==
1
)
{
BaseNo
no
=
spareNoCache
.
getExecutIngSpareNo
();
BaseNo
no
=
spareNoCache
.
getExecutIngSpareNo
();
if
(
ObjectUtil
.
isNull
(
no
))
{
if
(
ObjectUtil
.
isNull
(
no
))
{
return
null
;
}
spareNoDetails
=
no
.
getDetailList
();
if
(
spareNoDetails
==
null
)
{
no
=
returnNoCache
.
getExecutingOrderNo
();
no
=
returnNoCache
.
getExecutingOrderNo
();
spareNoDetails
=
no
.
getDetailList
();
}
}
spareNoDetails
=
no
.
getDetailList
();
}
else
if
(
type
==
2
)
{
}
else
if
(
type
==
2
)
{
Unclaimed
orderNo
=
orderNoCache
.
getExecutingOrderNo
();
LiteOrder
executingOrder
=
liteOrderCache
.
getExecutingOrder
();
spareNoDetails
=
orderNo
.
getDetailList
().
stream
().
map
((
Function
<
UnclaimedDetail
,
SpareNoDetail
>)
unclaimedDetail
->
{
if
(
executingOrder
==
null
)
{
SpareNoDetail
detail
=
new
SpareNoDetail
();
return
spareNoDetails
;
detail
.
setAlrInQty
(
unclaimedDetail
.
getAlrInQty
());
}
detail
.
setInQty
(
unclaimedDetail
.
getApplyQty
());
List
<
LiteOrderItem
>
orderItems
=
executingOrder
.
getOrderItems
();
detail
.
setPartno
(
unclaimedDetail
.
getPartno
());
spareNoDetails
=
orderItems
.
stream
().
map
(
new
Function
<
LiteOrderItem
,
SpareNoDetail
>()
{
detail
.
setPartname
(
unclaimedDetail
.
getPartname
());
@Override
return
null
;
public
SpareNoDetail
apply
(
LiteOrderItem
liteOrderItem
)
{
SpareNoDetail
detail
=
new
SpareNoDetail
();
detail
.
setAlrInQty
(
liteOrderItem
.
getTotalOutNum
());
detail
.
setInQty
(
liteOrderItem
.
getNeedNum
());
detail
.
setPartno
(
liteOrderItem
.
getPn
());
return
detail
;
}
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
// Unclaimed orderNo = orderNoCache.getExecutingOrderNo();
// spareNoDetails = orderNo.getDetailList().stream().map(unclaimedDetail -> {
// SpareNoDetail detail = new SpareNoDetail();
// detail.setAlrInQty(unclaimedDetail.getAlrInQty());
// detail.setInQty(unclaimedDetail.getApplyQty());
// detail.setPartno(unclaimedDetail.getPartno());
// detail.setPartname(unclaimedDetail.getPartname());
// return detail;
// }).collect(Collectors.toList());
}
}
return
spareNoDetails
;
return
spareNoDetails
;
}
}
...
@@ -140,6 +152,7 @@ public class SpBoxUtil {
...
@@ -140,6 +152,7 @@ public class SpBoxUtil {
pars
.
add
(
par
);
pars
.
add
(
par
);
}
}
if
(
boxStr
.
startsWith
(
"CS"
))
{
if
(
boxStr
.
startsWith
(
"CS"
))
{
if
(
"A"
.
equals
(
suffix
))
{
if
(
"A"
.
equals
(
suffix
))
{
resultList
.
add
(
pars
.
get
(
1
));
resultList
.
add
(
pars
.
get
(
1
));
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论