Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
pms
Commits
07e82b2a
提交
07e82b2a
authored
5月 17, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MiniProgram
上级
1aec4c41
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
28 行增加
和
46 行删除
+28
-46
MiniProgramProductMallServiceImpl.java
...c/pms/service/Impl/MiniProgramProductMallServiceImpl.java
+27
-45
MiniProgramProductMallDao.xml
src/main/resources/mapper/MiniProgramProductMallDao.xml
+1
-1
没有找到文件。
src/main/java/com/mmc/pms/service/Impl/MiniProgramProductMallServiceImpl.java
浏览文件 @
07e82b2a
...
...
@@ -19,6 +19,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
* @Author small @Date 2023/5/16 15:08 @Version 1.0
...
...
@@ -171,54 +172,35 @@ public class MiniProgramProductMallServiceImpl implements MiniProgramProductMall
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
));
}
private
List
<
GoodsSpecDTO
>
getIndustrySpecInfo
(
Integer
goodsInfoId
)
{
// 获取商品对应绑定的行业sku信息
List
<
MallIndustrySkuInfoDO
>
mallIndustrySkuInfoList
=
goodsInfoDao
.
getMallIndustrySkuInfo
(
goodsInfoId
);
List
<
GoodsSpecDTO
>
list
=
mallIndustrySkuInfoList
.
stream
()
.
map
(
MallIndustrySkuInfoDO:
:
buildGoodsSpecDTO
)
.
collect
(
Collectors
.
toList
());
List
<
MallIndustrySkuInfoDO
>
mallIndustrySkuInfoList
=
goodsInfoDao
.
getMallIndustrySkuInfo
(
goodsInfoId
);
List
<
GoodsSpecDTO
>
list
=
mallIndustrySkuInfoList
.
stream
().
map
(
MallIndustrySkuInfoDO:
:
buildGoodsSpecDTO
).
collect
(
Collectors
.
toList
());
// 根据商品id查出该商品下绑定的规格信息
List
<
MallIndustrySkuInfoSpecDO
>
mallIndustrySkuInfoSpec
=
goodsInfoDao
.
getIndustrySkuInfoSpec
(
goodsInfoId
);
list
=
list
.
stream
()
.
peek
(
d
->
{
List
<
MallIndustrySpecDTO
>
industrySpec
=
new
ArrayList
<>();
for
(
MallIndustrySkuInfoSpecDO
e
:
mallIndustrySkuInfoSpec
)
{
if
(
d
.
getId
().
equals
(
e
.
getMallIndustrySkuInfoId
()))
{
IndustrySpecDO
industrySpecDO
=
e
.
getIndustrySpecDO
();
// 获取商品清单信息
List
<
IndustryProductInventoryDO
>
industryProdInventory
=
goodsInfoDao
.
getIndustryProductInventory
(
e
.
getIndustrySpecId
());
List
<
ProductInventoryVO
>
productInventoryList
=
new
ArrayList
<>();
// 获取行业规格绑定的产品规格信息
List
<
InventorySpecDO
>
inventorySpecDOList
=
goodsInfoDao
.
listInventorySpec
(
industryProdInventory
.
stream
()
.
map
(
IndustryProductInventoryDO:
:
getId
)
.
collect
(
Collectors
.
toList
()));
Map
<
Integer
,
List
<
InventorySpecDO
>>
inventoryMap
=
inventorySpecDOList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
InventorySpecDO:
:
getIndustryProductInventoryId
));
getIndustrySpecOnProdSpecInfo
(
industryProdInventory
,
productInventoryList
,
inventoryMap
);
MallIndustrySpecDTO
industrySpecDTO
=
industrySpecDO
.
buildMallIndustrySpecDTO
();
industrySpecDTO
.
setId
(
e
.
getId
());
industrySpecDTO
.
setIndustrySpecId
(
e
.
getIndustrySpecId
());
industrySpecDTO
.
setIndustrySkuId
(
d
.
getSkuId
());
industrySpecDTO
.
setProductInventoryList
(
productInventoryList
);
industrySpec
.
add
(
industrySpecDTO
);
}
}
d
.
setIndustrySpecList
(
industrySpec
);
})
.
collect
(
Collectors
.
toList
());
List
<
MallIndustrySkuInfoSpecDO
>
mallIndustrySkuInfoSpec
=
goodsInfoDao
.
getIndustrySkuInfoSpec
(
goodsInfoId
);
list
=
list
.
stream
().
peek
(
d
->
{
List
<
MallIndustrySpecDTO
>
industrySpec
=
new
ArrayList
<>();
for
(
MallIndustrySkuInfoSpecDO
e
:
mallIndustrySkuInfoSpec
)
{
if
(
d
.
getId
().
equals
(
e
.
getMallIndustrySkuInfoId
()))
{
IndustrySpecDO
industrySpecDO
=
e
.
getIndustrySpecDO
();
// 获取商品清单信息
List
<
IndustryProductInventoryDO
>
industryProdInventory
=
goodsInfoDao
.
getIndustryProductInventory
(
e
.
getIndustrySpecId
());
List
<
ProductInventoryVO
>
productInventoryList
=
new
ArrayList
<>();
// 获取行业规格绑定的产品规格信息
List
<
InventorySpecDO
>
inventorySpecDOList
=
goodsInfoDao
.
listInventorySpec
(
industryProdInventory
.
stream
().
map
(
IndustryProductInventoryDO:
:
getId
).
collect
(
Collectors
.
toList
()));
Map
<
Integer
,
List
<
InventorySpecDO
>>
inventoryMap
=
inventorySpecDOList
.
stream
().
collect
(
Collectors
.
groupingBy
(
InventorySpecDO:
:
getIndustryProductInventoryId
));
getIndustrySpecOnProdSpecInfo
(
industryProdInventory
,
productInventoryList
,
inventoryMap
);
MallIndustrySpecDTO
industrySpecDTO
=
industrySpecDO
.
buildMallIndustrySpecDTO
();
industrySpecDTO
.
setId
(
e
.
getId
());
industrySpecDTO
.
setIndustrySpecId
(
e
.
getIndustrySpecId
());
industrySpecDTO
.
setIndustrySkuId
(
d
.
getSkuId
());
industrySpecDTO
.
setProductInventoryList
(
productInventoryList
);
industrySpec
.
add
(
industrySpecDTO
);
}
}
d
.
setIndustrySpecList
(
industrySpec
);
}).
collect
(
Collectors
.
toList
());
return
list
;
}
...
...
src/main/resources/mapper/MiniProgramProductMallDao.xml
浏览文件 @
07e82b2a
...
...
@@ -321,7 +321,7 @@
product_sku_id productSkuId,
is_selected selected
FROM industry_product_inventory
WHERE industry_spec_id = #{id}
WHERE industry_spec_id = #{i
ndustrySpecI
d}
AND is_deleted = 0
</select>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论