Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 76a758e3
由
LN
编写于
2023-05-11 16:35:32 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
bug修改
1 个父辈
1e0fedc2
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
92 行增加
和
15 行删除
src/main/java/com/neotel/smfcore/core/selfAudit/rest/SelfAuditDeviceController.java
src/main/java/com/neotel/smfcore/custom/micron20031/MicronInventoryReportsController.java
src/main/java/com/neotel/smfcore/custom/micron20031/MicronPerformanceReportsController.java
src/main/java/com/neotel/smfcore/core/selfAudit/rest/SelfAuditDeviceController.java
查看文件 @
76a758e
...
...
@@ -194,15 +194,43 @@ public class SelfAuditDeviceController {
StoragePos
storagePos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
storagePos
!=
null
)
{
try
{
if
(
ObjectUtil
.
isNotEmpty
(
barcode
)&&
barcode
.
equals
(
actualBarcode
)){
Barcode
barcode1
=
codeResolve
.
resolveOneValideBarcode
(
barcode
);
if
(
barcode1
!=
null
){
log
.
info
(
"盘点入库完成,条码一致,自动生成入库任务,更新库位["
+
storagePos
.
getPosName
()
+
"]"
);
taskService
.
addTaskToFinished
(
storagePos
,
barcode1
,
"selfAudit"
);
if
(
ObjectUtil
.
isNotEmpty
(
barcode
)
){
if
(
barcode
.
equals
(
actualBarcode
))
{
//物料一致
Barcode
barcodeIn
=
codeResolve
.
resolveOneValideBarcode
(
barcode
);
if
(
barcodeIn
!=
null
)
{
log
.
info
(
"盘点入库完成,条码一致,自动生成入库任务,更新库位["
+
storagePos
.
getPosName
()
+
"]=["
+
barcodeIn
.
getBarcode
()
+
"]"
);
taskService
.
addTaskToFinished
(
storagePos
,
barcodeIn
,
"selfAudit"
);
}
}
else
if
(
ObjectUtil
.
isNotEmpty
(
actualBarcode
)){
//物料不一致 优先实际条码入库
Barcode
barcodeIn
=
codeResolve
.
resolveOneValideBarcode
(
actualBarcode
);
if
(
barcodeIn
!=
null
){
log
.
info
(
"盘点入库完成,物料不一致,自动生成实际条码入库任务,更新库位["
+
storagePos
.
getPosName
()
+
"]=["
+
barcodeIn
.
getBarcode
()+
"]"
);
taskService
.
addTaskToFinished
(
storagePos
,
barcodeIn
,
"selfAudit"
);
}
else
{
barcodeIn
=
codeResolve
.
resolveOneValideBarcode
(
barcode
);
if
(
barcodeIn
!=
null
){
log
.
info
(
"盘点入库完成,条码一致,实际条码解析失败,自动生成原条码入库任务,更新库位["
+
storagePos
.
getPosName
()
+
"]=["
+
barcodeIn
.
getBarcode
()+
"]"
);
taskService
.
addTaskToFinished
(
storagePos
,
barcodeIn
,
"selfAudit"
);
}
}
}
else
{
//库存有料,实际没料
}
}
else
if
(
ObjectUtil
.
isNotEmpty
(
actualBarcode
)){
//库存没料,实际有料
//物料不一致 优先实际条码入库
Barcode
barcodeIn
=
codeResolve
.
resolveOneValideBarcode
(
actualBarcode
);
if
(
barcodeIn
!=
null
){
log
.
info
(
"盘点入库完成,库存没料,实际有料,自动生成实际条码入库任务,更新库位["
+
storagePos
.
getPosName
()
+
"]=["
+
barcodeIn
.
getBarcode
()+
"]"
);
taskService
.
addTaskToFinished
(
storagePos
,
barcodeIn
,
"selfAudit"
);
}
else
{
log
.
error
(
"盘点入库完成,库存没料,实际有料,实际条码解析失败,生成入库任务失败,库位["
+
storagePos
.
getPosName
()
+
"]库存仍为空"
);
}
}
//TODO
//TODO
如果原来有料,默认增加一条入库任务
}
catch
(
Exception
e
)
{
throw
new
ValidateException
(
"smfcore.error"
,
"出错{0}"
,
new
String
[]{
e
.
toString
()});
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/MicronInventoryReportsController.java
查看文件 @
76a758e
...
...
@@ -19,12 +19,15 @@ import com.neotel.smfcore.core.storage.rest.mapstruct.StoragePosMapper;
import
com.neotel.smfcore.core.storage.rest.query.InventoryQueryCriteria
;
import
com.neotel.smfcore.core.storage.rest.query.StoragePosFindCriteria
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.manager.IDataLogManager
;
import
com.neotel.smfcore.custom.micron20031.bean.MInOutType
;
import
com.neotel.smfcore.custom.micron20031.bean.SpDailyLog
;
import
com.neotel.smfcore.custom.micron20031.bean.dto.SpDailyLogDto
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.service.manager.IGroupManager
;
import
com.neotel.smfcore.security.service.po.Group
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -68,6 +71,8 @@ public class MicronInventoryReportsController {
@Autowired
private
SelfAuditItemMapper
selfAuditItemMapper
;
@Autowired
private
final
IGroupManager
groupManager
;
@ApiOperation
(
"Inventory Chart(All) I2 :库存列表饼图报表"
)
@GetMapping
(
value
=
"/inventory"
)
...
...
@@ -233,6 +238,21 @@ public class MicronInventoryReportsController {
}
PageData
<
StoragePos
>
pages
=
storagePosManager
.
findByPage
(
query
,
pageable
);
List
<
StoragePosDto
>
StoragePosDtos
=
storagePosMapper
.
toDto
(
pages
.
getContent
());
for
(
StoragePosDto
dto
:
StoragePosDtos
)
{
Storage
storage
=
dataCache
.
getStorageById
(
dto
.
getStorageId
());
if
(
storage
!=
null
){
dto
.
setStorageName
(
storage
.
getName
());
if
(
ObjectUtil
.
isNotEmpty
(
storage
.
getGroupId
())){
Group
group
=
groupManager
.
get
(
storage
.
getGroupId
());
if
(
group
!=
null
){
dto
.
setGroupId
(
group
.
getId
());
dto
.
setGroupName
(
group
.
getGroupName
());
}
}
}
}
return
new
PageData
(
StoragePosDtos
,
pages
.
getTotalElements
());
}
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/MicronPerformanceReportsController.java
查看文件 @
76a758e
...
...
@@ -144,22 +144,51 @@ public class MicronPerformanceReportsController {
}
}
List
<
OperatingTimeDto
>
result
=
new
ArrayList
<>();
for
(
String
key
:
dtoMap
.
keySet
())
{
Date
time
=
DateUtil
.
toDate
(
key
,
"yyyy-MM-dd"
);
if
(
time
.
after
(
startTime
)
&&
time
.
before
(
endTime
))
{
List
<
String
>
list
=
getDatesBetween
(
startTime
,
endTime
);
OperatingTimeDto
dto
=
dtoMap
.
get
(
key
);
for
(
String
t
:
list
)
{
OperatingTimeDto
dto
=
dtoMap
.
getOrDefault
(
t
,
new
OperatingTimeDto
(
""
,
""
,
t
));
if
(
ObjectUtil
.
isNotEmpty
(
dto
.
getStorageId
())){
Storage
storage
=
dataCache
.
getStorageById
(
dto
.
getStorageId
());
dto
.
setCid
(
dto
.
getCid
());
dto
.
setStorageName
(
dto
.
getStorageName
());
result
.
add
(
dto
);
}
result
.
add
(
dto
);
}
// for (String key :
// dtoMap.keySet()) {
//
// Date time = DateUtil.toDate(key, "yyyy-MM-dd");
// if (time.after(startTime) && time.before(endTime)) {
//
// OperatingTimeDto dto = dtoMap.get(key);
// Storage storage = dataCache.getStorageById(dto.getStorageId());
// dto.setCid(dto.getCid());
// dto.setStorageName(dto.getStorageName());
// result.add(dto);
// }
// }
return
result
;
}
public
static
List
<
String
>
getDatesBetween
(
Date
startDate
,
Date
endDate
)
{
// DateTimeFormat formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
List
<
String
>
dates
=
new
ArrayList
<>();
while
(!
startDate
.
after
(
endDate
))
{
dates
.
add
(
DateUtil
.
toDateString
(
startDate
,
"yyyy-MM-dd"
));
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
startDate
);
calendar
.
add
(
Calendar
.
DATE
,
1
);
startDate
=
calendar
.
getTime
();
}
return
dates
;
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论