Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
pms
Commits
0ce1a09f
提交
0ce1a09f
authored
7月 05, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复:商品编辑
上级
302f97c2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
14 行增加
和
14 行删除
+14
-14
GoodsInfoServiceImpl.java
...n/java/com/mmc/pms/service/impl/GoodsInfoServiceImpl.java
+14
-10
GoodsInfoDao.xml
src/main/resources/mapper/GoodsInfoDao.xml
+0
-4
没有找到文件。
src/main/java/com/mmc/pms/service/impl/GoodsInfoServiceImpl.java
浏览文件 @
0ce1a09f
...
@@ -377,17 +377,12 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
...
@@ -377,17 +377,12 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateMallProductSkuSpec
(
GoodsAddVO
goodsAddVO
)
{
public
void
updateMallProductSkuSpec
(
GoodsAddVO
goodsAddVO
)
{
GoodsInfo
goodsInfo
=
new
GoodsInfo
(
goodsAddVO
);
GoodsInfo
goodsInfo
=
new
GoodsInfo
(
goodsAddVO
);
// 1、普通的sku修改逻辑
List
<
GoodsProdSpecVO
>
specInfo
=
goodsAddVO
.
getProductSpec
().
stream
()
.
filter
(
spec
->
!
spec
.
getFlag
().
equals
(
1
))
.
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
specInfo
))
{
// 1.1先获取用户输入的商品绑定sku的id集合
// 1.1先获取用户输入的商品绑定sku的id集合
List
<
GoodsProdSpecVO
>
updateGoodsSpec
=
List
<
GoodsProdSpecVO
>
productSpec
=
goodsAddVO
.
getProductSpec
();
specInfo
.
stream
().
filter
(
d
->
d
.
getId
()
!=
null
).
collect
(
Collectors
.
toList
());
// 获取不为空的产品规格
List
<
GoodsProdSpecVO
>
prod
=
productSpec
.
stream
().
filter
(
d
->
d
.
getId
()
!=
null
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
inputMallSkuIds
=
List
<
Integer
>
inputMallSkuIds
=
updateGoodsSpec
.
stream
().
map
(
GoodsProdSpecVO:
:
getId
).
collect
(
Collectors
.
toList
());
prod
.
stream
().
map
(
GoodsProdSpecVO:
:
getId
).
collect
(
Collectors
.
toList
());
// 1.2从数据库获取该商品对应绑定的skuId的集合
// 1.2从数据库获取该商品对应绑定的skuId的集合
List
<
MallProdInfoDO
>
mallProSkuInfoList
=
goodsInfoDao
.
getMallProSkuInfo
(
goodsAddVO
.
getId
());
List
<
MallProdInfoDO
>
mallProSkuInfoList
=
goodsInfoDao
.
getMallProSkuInfo
(
goodsAddVO
.
getId
());
List
<
Integer
>
dbMallSkuIds
=
List
<
Integer
>
dbMallSkuIds
=
...
@@ -402,6 +397,15 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
...
@@ -402,6 +397,15 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
goodsInfoDao
.
batchUpdateMallProSpec
(
delIds
,
goodsAddVO
.
getId
());
goodsInfoDao
.
batchUpdateMallProSpec
(
delIds
,
goodsAddVO
.
getId
());
goodsInfoDao
.
batchUpdateMallProductSku
(
delIds
);
goodsInfoDao
.
batchUpdateMallProductSku
(
delIds
);
}
}
// 1、普通的sku修改逻辑
List
<
GoodsProdSpecVO
>
specInfo
=
goodsAddVO
.
getProductSpec
().
stream
()
.
filter
(
spec
->
!
spec
.
getFlag
().
equals
(
1
))
.
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
specInfo
))
{
// 1.1先获取用户输入的商品绑定sku的id集合
List
<
GoodsProdSpecVO
>
updateGoodsSpec
=
specInfo
.
stream
().
filter
(
d
->
d
.
getId
()
!=
null
).
collect
(
Collectors
.
toList
());
// 修改商品绑定的sku信息
// 修改商品绑定的sku信息
List
<
MallProdInfoDO
>
mallProdSkuInfoList
=
List
<
MallProdInfoDO
>
mallProdSkuInfoList
=
updateGoodsSpec
.
stream
()
updateGoodsSpec
.
stream
()
...
@@ -547,6 +551,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
...
@@ -547,6 +551,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
goodsInfoDao
.
insertMallProdSkuInfoSpec
(
mallProdSkuInfoSpecDO
);
goodsInfoDao
.
insertMallProdSkuInfoSpec
(
mallProdSkuInfoSpecDO
);
}
}
}
}
}
// 2.2 新增新的自定义规格信息
// 2.2 新增新的自定义规格信息
List
<
GoodsProdSpecVO
>
newZdySpec
=
List
<
GoodsProdSpecVO
>
newZdySpec
=
zdySpecInfo
.
stream
().
filter
(
d
->
d
.
getId
()
==
null
).
collect
(
Collectors
.
toList
());
zdySpecInfo
.
stream
().
filter
(
d
->
d
.
getId
()
==
null
).
collect
(
Collectors
.
toList
());
...
@@ -554,7 +559,6 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
...
@@ -554,7 +559,6 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
productSkuSpecOperation
(
goodsInfo
,
newZdySpec
);
productSkuSpecOperation
(
goodsInfo
,
newZdySpec
);
}
}
}
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateOtherService
(
GoodsAddVO
goodsAddVO
)
{
public
void
updateOtherService
(
GoodsAddVO
goodsAddVO
)
{
...
...
src/main/resources/mapper/GoodsInfoDao.xml
浏览文件 @
0ce1a09f
...
@@ -207,23 +207,19 @@
...
@@ -207,23 +207,19 @@
mi.goods_info_id,
mi.goods_info_id,
mi.product_id productId,
mi.product_id productId,
mi.prod_spec_name prodSkuSpecName,
mi.prod_spec_name prodSkuSpecName,
mi.categories_id categoriesId,
mi.choose_type chooseType,
mi.choose_type chooseType,
mi.sku_unit_id skuUnitId,
mi.sku_unit_id skuUnitId,
mi.is_must must,
mi.is_must must,
mi.flag flag,
mi.flag flag,
mi.create_time createTime,
mi.create_time createTime,
c.name typeName,
su.id skuUnitId,
su.id skuUnitId,
su.unit_name unitName,
su.unit_name unitName,
ps.product_name productSkuName
ps.product_name productSkuName
FROM mall_prod_info mi
FROM mall_prod_info mi
INNER JOIN categories c ON c.id = mi.categories_id
INNER JOIN sku_unit su ON mi.sku_unit_id = su.id
INNER JOIN sku_unit su ON mi.sku_unit_id = su.id
INNER JOIN product ps ON ps.id = mi.product_id
INNER JOIN product ps ON ps.id = mi.product_id
WHERE mi.goods_info_id = #{id}
WHERE mi.goods_info_id = #{id}
AND mi.is_deleted = 0
AND mi.is_deleted = 0
and flag = 0
</select>
</select>
<select
id=
"getMallIndustrySkuInfo"
resultType=
"com.mmc.pms.entity.MallIndustrySkuInfoDO"
>
<select
id=
"getMallIndustrySkuInfo"
resultType=
"com.mmc.pms.entity.MallIndustrySkuInfoDO"
>
SELECT mi.id,
SELECT mi.id,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论