Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6f439f44
由
LN
编写于
2024-08-05 09:49:15 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
库存报表bug修改
1 个父辈
19826964
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
22 行增加
和
5 行删除
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
查看文件 @
6f439f4
...
@@ -992,23 +992,40 @@ public class StoragePosManagerImpl implements IStoragePosManager {
...
@@ -992,23 +992,40 @@ public class StoragePosManagerImpl implements IStoragePosManager {
}
}
// c.and("barcode.status").is(BARCODE_STATUS.IN_STORE);
// c.and("barcode.status").is(BARCODE_STATUS.IN_STORE);
c
=
c
.
and
(
"barcode.subCodeList"
).
exists
(
true
);
c
=
c
.
and
(
"barcode.subCodeList"
).
exists
(
true
);
// Aggregation agg = Aggregation.newAggregation(
// Aggregation.match(c),
// Aggregation.unwind("barcode.subCodeList"),
// Aggregation.group("barcode.subCodeList.partNumber")
// .first("barcode.subCodeList.partNumber").as("partNumber")
// .first("barcode.barcode").as("boxName")
// .first("barcode.subCodeList.barcode").as("gekouName")
// .first("barcode.subCodeList.pn").as("partname")
// .first("wareHouseCode").as("wareHouseCode")
// .sum("barcode.subCodeList.amount").as("stockCount").count().as("stockReel"),
// Aggregation.project("stockCount", "stockReel")
// .and("partNumber").as("partNumber")
// .and("boxName").as("boxName")
// .and("partname").as("partname")
// .and("gekouName").as("gekouName")
// .and("wareHouseCode").as("wareHouseCode")
//
// );
Aggregation
agg
=
Aggregation
.
newAggregation
(
Aggregation
agg
=
Aggregation
.
newAggregation
(
Aggregation
.
match
(
c
),
Aggregation
.
match
(
c
),
Aggregation
.
unwind
(
"barcode.subCodeList"
),
Aggregation
.
unwind
(
"barcode.subCodeList"
),
Aggregation
.
group
(
"barcode.subCodeList.partNumber"
)
Aggregation
.
group
(
"barcode.subCodeList.partNumber"
)
.
first
(
"barcode.subCodeList.partNumber"
).
as
(
"partNumber"
)
.
first
(
"barcode.subCodeList.partNumber"
).
as
(
"partNumber
Group
"
)
.
first
(
"barcode.barcode"
).
as
(
"boxName"
)
.
first
(
"barcode.barcode"
).
as
(
"boxName"
)
.
first
(
"barcode.subCodeList.barcode"
).
as
(
"gekouName"
)
.
first
(
"barcode.subCodeList.barcode"
).
as
(
"gekouName"
)
.
first
(
"barcode.subCodeList.pn"
).
as
(
"partname"
)
.
first
(
"barcode.subCodeList.pn"
).
as
(
"partname"
)
.
first
(
"wareHouseCode"
).
as
(
"wareHouseCode"
)
.
first
(
"wareHouseCode"
).
as
(
"wareHouseCode"
)
.
sum
(
"barcode.subCodeList.amount"
).
as
(
"
s
tockCount"
).
count
().
as
(
"stockReel"
),
.
sum
(
"barcode.subCodeList.amount"
).
as
(
"
totalS
tockCount"
).
count
().
as
(
"stockReel"
),
Aggregation
.
project
(
"
s
tockCount"
,
"stockReel"
)
Aggregation
.
project
(
"
totalS
tockCount"
,
"stockReel"
)
.
and
(
"partNumber"
).
as
(
"partNumber"
)
.
and
(
"partNumber
Group
"
).
as
(
"partNumber"
)
.
and
(
"boxName"
).
as
(
"boxName"
)
.
and
(
"boxName"
).
as
(
"boxName"
)
.
and
(
"partname"
).
as
(
"partname"
)
.
and
(
"partname"
).
as
(
"partname"
)
.
and
(
"gekouName"
).
as
(
"gekouName"
)
.
and
(
"gekouName"
).
as
(
"gekouName"
)
.
and
(
"wareHouseCode"
).
as
(
"wareHouseCode"
)
.
and
(
"wareHouseCode"
).
as
(
"wareHouseCode"
)
);
);
AggregationResults
<
InventoryItem
>
results
=
storagePosDao
.
getMongoTemplate
().
aggregate
(
agg
,
StoragePos
.
class
,
InventoryItem
.
class
);
AggregationResults
<
InventoryItem
>
results
=
storagePosDao
.
getMongoTemplate
().
aggregate
(
agg
,
StoragePos
.
class
,
InventoryItem
.
class
);
return
results
.
getMappedResults
();
return
results
.
getMappedResults
();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论