Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
pms-ci-test
Commits
40b7b899
提交
40b7b899
authored
7月 05, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复:商品编辑
上级
60fff22e
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
66 行增加
和
92 行删除
+66
-92
MallIndustrySkuInfoDO.java
src/main/java/com/mmc/pms/entity/MallIndustrySkuInfoDO.java
+0
-2
MallProdInfoDO.java
src/main/java/com/mmc/pms/entity/MallProdInfoDO.java
+0
-3
GoodsSpecDTO.java
src/main/java/com/mmc/pms/model/sale/dto/GoodsSpecDTO.java
+0
-6
GoodsProdSpecVO.java
src/main/java/com/mmc/pms/model/sale/vo/GoodsProdSpecVO.java
+2
-2
GoodsInfoServiceImpl.java
...n/java/com/mmc/pms/service/impl/GoodsInfoServiceImpl.java
+62
-73
MiniProgramProductMallServiceImpl.java
...c/pms/service/impl/MiniProgramProductMallServiceImpl.java
+0
-2
GoodsInfoDao.xml
src/main/resources/mapper/GoodsInfoDao.xml
+2
-4
没有找到文件。
src/main/java/com/mmc/pms/entity/MallIndustrySkuInfoDO.java
浏览文件 @
40b7b899
...
@@ -55,12 +55,10 @@ public class MallIndustrySkuInfoDO implements Serializable {
...
@@ -55,12 +55,10 @@ public class MallIndustrySkuInfoDO implements Serializable {
return
GoodsSpecDTO
.
builder
()
return
GoodsSpecDTO
.
builder
()
.
id
(
this
.
id
)
.
id
(
this
.
id
)
.
goodsSpecName
(
this
.
industrySkuSpecName
)
.
goodsSpecName
(
this
.
industrySkuSpecName
)
.
categoryId
(
this
.
categoriesId
)
.
chooseType
(
this
.
chooseType
)
.
chooseType
(
this
.
chooseType
)
.
skuUnitId
(
skuUnitId
)
.
skuUnitId
(
skuUnitId
)
.
unitName
(
this
.
unitName
)
.
unitName
(
this
.
unitName
)
.
skuId
(
this
.
industrySkuId
)
.
skuId
(
this
.
industrySkuId
)
.
typeName
(
this
.
typeName
)
.
skuName
(
this
.
industrySkuName
)
.
skuName
(
this
.
industrySkuName
)
.
must
(
must
)
.
must
(
must
)
.
build
();
.
build
();
...
...
src/main/java/com/mmc/pms/entity/MallProdInfoDO.java
浏览文件 @
40b7b899
...
@@ -53,12 +53,9 @@ public class MallProdInfoDO implements Serializable {
...
@@ -53,12 +53,9 @@ public class MallProdInfoDO implements Serializable {
return
GoodsSpecDTO
.
builder
()
return
GoodsSpecDTO
.
builder
()
.
id
(
this
.
id
)
.
id
(
this
.
id
)
.
goodsSpecName
(
this
.
prodSkuSpecName
)
.
goodsSpecName
(
this
.
prodSkuSpecName
)
.
categoryId
(
this
.
categoriesId
)
.
chooseType
(
this
.
chooseType
)
.
chooseType
(
this
.
chooseType
)
.
skuUnitId
(
skuUnitId
)
.
skuUnitId
(
skuUnitId
)
.
unitName
(
this
.
unitName
)
.
unitName
(
this
.
unitName
)
.
skuId
(
this
.
productId
)
.
typeName
(
this
.
typeName
)
.
must
(
must
)
.
must
(
must
)
.
skuName
(
this
.
productSkuName
)
.
skuName
(
this
.
productSkuName
)
.
brandInfoId
(
brandInfoId
)
.
brandInfoId
(
brandInfoId
)
...
...
src/main/java/com/mmc/pms/model/sale/dto/GoodsSpecDTO.java
浏览文件 @
40b7b899
...
@@ -27,12 +27,6 @@ public class GoodsSpecDTO implements Serializable {
...
@@ -27,12 +27,6 @@ public class GoodsSpecDTO implements Serializable {
@ApiModelProperty
(
value
=
"规格名称"
)
@ApiModelProperty
(
value
=
"规格名称"
)
private
String
goodsSpecName
;
private
String
goodsSpecName
;
@ApiModelProperty
(
value
=
"产品或行业类型"
)
private
Integer
categoryId
;
@ApiModelProperty
(
value
=
"产品或行业类型名称"
)
private
String
typeName
;
@ApiModelProperty
(
value
=
"产品或行业skuId"
)
@ApiModelProperty
(
value
=
"产品或行业skuId"
)
private
Integer
skuId
;
private
Integer
skuId
;
...
...
src/main/java/com/mmc/pms/model/sale/vo/GoodsProdSpecVO.java
浏览文件 @
40b7b899
...
@@ -28,9 +28,9 @@ public class GoodsProdSpecVO implements Serializable {
...
@@ -28,9 +28,9 @@ public class GoodsProdSpecVO implements Serializable {
@ApiModelProperty
(
value
=
"产品类型id"
)
@ApiModelProperty
(
value
=
"产品类型id"
)
private
Integer
categoryId
;
private
Integer
categoryId
;
@ApiModelProperty
(
value
=
"产品:新增自定义时此字段可不用填写"
)
@ApiModelProperty
(
value
=
"产品:自定义时此字段可不用填写"
)
private
Integer
skuId
;
private
Integer
skuId
;
@ApiModelProperty
(
value
=
"规格来源 0:获取 1:自定义"
)
@ApiModelProperty
(
value
=
"规格来源 0:获取 1:自定义"
)
private
Integer
flag
;
private
Integer
flag
;
...
...
src/main/java/com/mmc/pms/service/impl/GoodsInfoServiceImpl.java
浏览文件 @
40b7b899
...
@@ -485,85 +485,74 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
...
@@ -485,85 +485,74 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateCustomize
(
GoodsInfo
goodsInfo
,
List
<
GoodsProdSpecVO
>
zdySpecInfo
,
Integer
id
)
{
public
void
updateCustomize
(
GoodsInfo
goodsInfo
,
List
<
GoodsProdSpecVO
>
zdySpecInfo
,
Integer
id
)
{
// 获取自定义产品及规格信息(获取带id的)
// 先获取自定义的sku及规格(原来有的)
List
<
GoodsProdSpecVO
>
zdySpec
=
List
<
GoodsProdSpecVO
>
zdySpec
=
zdySpecInfo
.
stream
().
filter
(
d
->
d
.
getId
()
!=
null
).
collect
(
Collectors
.
toList
());
zdySpecInfo
.
stream
().
filter
(
d
->
d
.
getId
()
!=
null
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
zdySpec
))
{
if
(
CollectionUtils
.
isNotEmpty
(
zdySpec
))
{
// 根据获取到的自定义sku及规格进行操作
for
(
GoodsProdSpecVO
d
:
zdySpec
)
{
List
<
MallProdInfoDO
>
zdySpecList
=
// 修改产品的规格基本信息
zdySpec
.
stream
()
MallProdInfoDO
mallProdInfoDO
=
new
MallProdInfoDO
(
d
).
setId
(
d
.
getId
()).
setProductId
(
d
.
getSkuId
());
.
map
(
d
->
{
// 构建商品对应的sku信息
ProductDO
productSkuDO
=
new
ProductDO
().
setId
(
d
.
getSkuId
()).
setProductName
(
d
.
getProductName
());
productDao
.
updateProductSku
(
productSkuDO
);
return
new
MallProdInfoDO
(
d
).
setId
(
d
.
getId
()).
setProductId
(
d
.
getSkuId
());
})
.
collect
(
Collectors
.
toList
());
// 批量修改sku的信息
for
(
MallProdInfoDO
mallProdInfoDO
:
zdySpecList
)
{
goodsInfoDao
.
updateMallProdSkuInfo
(
mallProdInfoDO
);
goodsInfoDao
.
updateMallProdSkuInfo
(
mallProdInfoDO
);
}
// 构建商品对应的产品信息
// goodsInfoDao.batchUpdateMallProdSkuInfo(zdySpecList);
ProductDO
productSkuDO
=
}
new
ProductDO
().
setId
(
d
.
getSkuId
()).
setProductName
(
d
.
getProductName
());
for
(
GoodsProdSpecVO
goodsSpecVO
:
zdySpec
)
{
productDao
.
updateProductSku
(
productSkuDO
);
// 【1】获取输入的自定义规格信息// id不为空则修改
List
<
ProductSpecVO
>
customizeInfoList
=
List
<
ProductSpecVO
>
customizeInfoList
=
d
.
getCustomizeInfo
().
stream
()
goodsSpecVO
.
getCustomizeInfo
().
stream
()
.
filter
(
e
->
e
.
getId
()
!=
null
)
.
filter
(
d
->
d
.
getId
()
!=
null
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
// 【2】删除多余的自定义规格
for
(
ProductSpecVO
d
:
customizeInfoList
)
{
if
(!
CollectionUtils
.
isEmpty
(
d
.
getDelProductSpecId
()))
{
// ①修改价格配置
// 批量查出spec的数据
ProductSpecCPQVO
productSpecCPQVO
=
d
.
getProductSpecCPQVO
();
List
<
MallProdSkuInfoSpecDO
>
prodSkuInfoSpecList
=
// 删除所有的随后在新增
productDao
.
getProductSpecByIds
(
d
.
getDelProductSpecId
());
productDao
.
removeProductSpecCPQ
(
productSpecCPQVO
);
for
(
MallProdSkuInfoSpecDO
mallProdSkuInfoSpecDO
:
prodSkuInfoSpecList
)
{
productSkuService
.
insertSpecPrice
(
productSpecCPQVO
);
productDao
.
removeProductSpec
(
mallProdSkuInfoSpecDO
.
getProductSpecId
());
ProductSpecDO
productSpecDO
=
new
ProductSpecDO
(
d
);
}
productSpecDO
.
setId
(
productSpecCPQVO
.
getProductSpecId
());
goodsInfoDao
.
batchUpdateMallProdSpec
(
d
.
getDelProductSpecId
());
// ②在修改自定义的数据
}
productDao
.
updateProductSpec
(
productSpecDO
);
for
(
ProductSpecVO
e
:
customizeInfoList
)
{
}
// ①修改价格配置
// 【2】删除多余的自定义规格
ProductSpecCPQVO
productSpecCPQVO
=
e
.
getProductSpecCPQVO
();
if
(!
CollectionUtils
.
isEmpty
(
goodsSpecVO
.
getDelProductSpecId
()))
{
// 删除所有的随后在新增
// 批量查出spec的数据
productDao
.
removeProductSpecCPQ
(
productSpecCPQVO
);
List
<
MallProdSkuInfoSpecDO
>
prodSkuInfoSpecList
=
productSkuService
.
insertSpecPrice
(
productSpecCPQVO
);
productDao
.
getProductSpecByIds
(
goodsSpecVO
.
getDelProductSpecId
());
ProductSpecDO
productSpecDO
=
new
ProductSpecDO
(
e
);
for
(
MallProdSkuInfoSpecDO
mallProdSkuInfoSpecDO
:
prodSkuInfoSpecList
)
{
productSpecDO
.
setId
(
productSpecCPQVO
.
getProductSpecId
());
productDao
.
removeProductSpec
(
mallProdSkuInfoSpecDO
.
getProductSpecId
());
// ②在修改自定义的数据
productDao
.
updateProductSpec
(
productSpecDO
);
}
// 【3】新增最新的自定义规格
List
<
ProductSpecVO
>
collect
=
d
.
getCustomizeInfo
().
stream
()
.
filter
(
e
->
e
.
getId
()
==
null
)
.
collect
(
Collectors
.
toList
());
for
(
ProductSpecVO
param
:
collect
)
{
ProductSpecDO
productSpecDO
=
new
ProductSpecDO
(
param
);
// 新增产品sku
productDao
.
insertProductSpec
(
productSpecDO
);
// 批量配置价格信息
ProductSpecCPQVO
productSpecCPQVO
=
param
.
getProductSpecCPQVO
();
productSpecCPQVO
.
setProductSpecId
(
productSpecDO
.
getId
());
productSkuService
.
insertSpecPrice
(
productSpecCPQVO
);
// 构建商品对应的规格信息
MallProdSkuInfoSpecDO
mallProdSkuInfoSpecDO
=
new
MallProdSkuInfoSpecDO
()
.
setProductSpecId
(
productSpecDO
.
getId
())
.
setMallProdSkuInfoId
(
d
.
getId
())
.
setGoodsInfoId
(
id
);
// 插入数据库商品对应的规格信息
goodsInfoDao
.
insertMallProdSkuInfoSpec
(
mallProdSkuInfoSpecDO
);
}
}
goodsInfoDao
.
batchUpdateMallProdSpec
(
goodsSpecVO
.
getDelProductSpecId
());
}
}
// 【3】新增最新的自定义规格
// 2.2 新增新的自定义规格信息
List
<
ProductSpecVO
>
collect
=
List
<
GoodsProdSpecVO
>
newZdySpec
=
goodsSpecVO
.
getCustomizeInfo
().
stream
()
zdySpecInfo
.
stream
().
filter
(
d
->
d
.
getId
()
==
null
).
collect
(
Collectors
.
toList
());
.
filter
(
d
->
d
.
getId
()
==
null
)
if
(
CollectionUtils
.
isNotEmpty
(
newZdySpec
))
{
.
collect
(
Collectors
.
toList
());
productSkuSpecOperation
(
goodsInfo
,
newZdySpec
);
for
(
ProductSpecVO
param
:
collect
)
{
ProductSpecDO
productSpecDO
=
new
ProductSpecDO
(
param
);
// 新增产品sku
productDao
.
insertProductSpec
(
productSpecDO
);
// 批量配置价格信息
ProductSpecCPQVO
productSpecCPQVO
=
param
.
getProductSpecCPQVO
();
productSpecCPQVO
.
setProductSpecId
(
productSpecDO
.
getId
());
productSkuService
.
insertSpecPrice
(
productSpecCPQVO
);
// 构建商品对应的规格信息
MallProdSkuInfoSpecDO
mallProdSkuInfoSpecDO
=
new
MallProdSkuInfoSpecDO
()
.
setProductSpecId
(
productSpecDO
.
getId
())
.
setMallProdSkuInfoId
(
goodsSpecVO
.
getId
())
.
setGoodsInfoId
(
id
);
// 插入数据库商品对应的规格信息
goodsInfoDao
.
insertMallProdSkuInfoSpec
(
mallProdSkuInfoSpecDO
);
}
}
}
}
// 2.2 新增新的自定义规格信息
List
<
GoodsProdSpecVO
>
newZdySpec
=
zdySpecInfo
.
stream
().
filter
(
d
->
d
.
getId
()
==
null
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
newZdySpec
))
{
productSkuSpecOperation
(
goodsInfo
,
newZdySpec
);
}
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
src/main/java/com/mmc/pms/service/impl/MiniProgramProductMallServiceImpl.java
浏览文件 @
40b7b899
...
@@ -104,8 +104,6 @@ public class MiniProgramProductMallServiceImpl implements MiniProgramProductMall
...
@@ -104,8 +104,6 @@ public class MiniProgramProductMallServiceImpl implements MiniProgramProductMall
.
setGoodsSpecName
(
d
.
getProdSkuSpecName
())
.
setGoodsSpecName
(
d
.
getProdSkuSpecName
())
.
setSkuName
(
d
.
getProductSkuName
())
.
setSkuName
(
d
.
getProductSkuName
())
.
setBrandInfoId
(
d
.
getBrandInfoId
())
.
setBrandInfoId
(
d
.
getBrandInfoId
())
.
setCategoryId
(
d
.
getCategoriesId
())
.
setTypeName
(
d
.
getTypeName
())
.
setChooseType
(
d
.
getChooseType
())
.
setChooseType
(
d
.
getChooseType
())
.
setSkuUnitId
(
d
.
getSkuUnitId
())
.
setSkuUnitId
(
d
.
getSkuUnitId
())
.
setUnitName
(
d
.
getUnitName
())
.
setUnitName
(
d
.
getUnitName
())
...
...
src/main/resources/mapper/GoodsInfoDao.xml
浏览文件 @
40b7b899
...
@@ -72,6 +72,7 @@
...
@@ -72,6 +72,7 @@
update goods_info
update goods_info
set goods_name = #{goodsName},
set goods_name = #{goodsName},
eco_label = #{ecoLabel},
eco_label = #{ecoLabel},
directory_id = #{directoryId},
category_by_one = #{categoryByOne},
category_by_one = #{categoryByOne},
category_by_two = #{categoryByTwo},
category_by_two = #{categoryByTwo},
shelf_status = #{shelfStatus}
shelf_status = #{shelfStatus}
...
@@ -596,21 +597,18 @@
...
@@ -596,21 +597,18 @@
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 = #{
i
d}
WHERE mi.goods_info_id = #{
goodsInfoI
d}
AND mi.is_deleted = 0
AND mi.is_deleted = 0
ORDER BY mi.create_time asc
ORDER BY mi.create_time asc
</select>
</select>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论