Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 26dee82e
由
LN
编写于
2024-08-23 14:09:19 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
修改品名后更新库存报表
1 个父辈
06ed675a
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
63 行增加
和
1 行删除
src/main/java/com/neotel/smfcore/core/barcode/rest/BarcodeController.java
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
src/main/java/com/neotel/smfcore/core/barcode/rest/BarcodeController.java
查看文件 @
26dee82
...
@@ -15,12 +15,16 @@ import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
...
@@ -15,12 +15,16 @@ import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.utils.QrcodeUtils
;
import
com.neotel.smfcore.core.barcode.utils.QrcodeUtils
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.manager.impl.StoragePosManagerImpl
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.po.Settings
;
import
com.neotel.smfcore.core.system.service.po.Settings
;
import
com.neotel.smfcore.security.bean.FileProperties
;
import
com.neotel.smfcore.security.bean.FileProperties
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.bytebuddy.asm.Advice
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Query
;
...
@@ -57,6 +61,9 @@ public class BarcodeController {
...
@@ -57,6 +61,9 @@ public class BarcodeController {
@Autowired
@Autowired
private
final
FileProperties
properties
;
private
final
FileProperties
properties
;
@Autowired
private
final
IStoragePosManager
storagePosManager
;
@ApiOperation
(
"导出条码数据"
)
@ApiOperation
(
"导出条码数据"
)
@GetMapping
(
value
=
"/download"
)
@GetMapping
(
value
=
"/download"
)
public
void
download
(
HttpServletResponse
response
,
BarcodeQueryCriteria
criteria
)
throws
Exception
{
public
void
download
(
HttpServletResponse
response
,
BarcodeQueryCriteria
criteria
)
throws
Exception
{
...
@@ -91,7 +98,36 @@ public class BarcodeController {
...
@@ -91,7 +98,36 @@ public class BarcodeController {
if
(
barcode
.
getId
()
==
null
)
{
if
(
barcode
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
}
barcodeManager
.
saveBarcode
(
barcode
);
barcode
=
barcodeManager
.
saveBarcode
(
barcode
);
//更新库存报表
dataCache
.
updateInventoryPn
(
barcode
.
getPartNumber
(),
barcode
.
getPn
());
//更改库位号和箱子中的信息
try
{
String
[]
array
=
barcode
.
getBarcode
().
split
(
"-"
);
if
(
array
.
length
==
2
){
String
boxbarcode
=
array
[
0
];
barcode
=
barcodeManager
.
get
(
barcode
.
getId
());
Barcode
boxCode
=
barcodeManager
.
findByBarcode
(
boxbarcode
);
if
(
boxCode
!=
null
){
boxCode
.
updateSubCodes
(
barcode
);
barcodeManager
.
save
(
boxCode
);
log
.
info
(
"修改条码"
+
barcode
.
getBarcode
()+
" 后,更新料箱"
+
boxCode
.
getBarcode
());
//修改库位
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
boxCode
.
getBarcode
());
if
(
pos
!=
null
){
pos
.
setBarcode
(
boxCode
);
storagePosManager
.
save
(
pos
);
log
.
info
(
"修改条码"
+
barcode
.
getBarcode
()+
" 后,更新所在库位"
+
pos
.
getPosName
());
}
}
}
}
catch
(
Exception
exception
){
log
.
error
(
"修改条码 "
+
barcode
.
getBarcode
()+
",更改箱子中的品名出错"
);
}
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
}
}
@ApiOperation
(
"删除条码"
)
@ApiOperation
(
"删除条码"
)
...
...
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
26dee82
...
@@ -572,6 +572,32 @@ public class DataCache {
...
@@ -572,6 +572,32 @@ public class DataCache {
inventoryMap
.
put
(
cid
,
storageInventoryMap
);
inventoryMap
.
put
(
cid
,
storageInventoryMap
);
return
storageInventoryMap
;
return
storageInventoryMap
;
}
}
public
boolean
updateInventoryPn
(
String
partNumber
,
String
partNo
)
{
try
{
if
(
ObjectUtil
.
isEmpty
(
partNo
))
{
partNo
=
""
;
}
if
(
ObjectUtil
.
isEmpty
(
partNumber
))
{
return
false
;
}
List
<
String
>
allStorageIds
=
new
ArrayList
<>(
inventoryMap
.
keySet
());
for
(
String
cid
:
allStorageIds
)
{
InventoryItem
inventoryItem
=
getStorageInventoryByPartNumber
(
cid
,
partNumber
);
if
(
inventoryItem
==
null
)
{
return
false
;
}
log
.
info
(
"updateInventoryPn : partNumber="
+
partNumber
+
",partNo="
+
partNo
);
inventoryItem
.
setPartname
(
partNo
);
updateStorageInventory
(
cid
,
inventoryItem
);
return
true
;
}
}
catch
(
Exception
exception
)
{
log
.
error
(
"updateInventoryPn partNumber="
+
partNumber
+
",partNo="
+
partNo
+
" error :"
+
exception
.
toString
());
}
return
false
;
}
/**
/**
* 手动修改数量的时候更新库存
* 手动修改数量的时候更新库存
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论