提交 4f4b315d 作者: xiaowang

修复:商品的编辑

上级 4e759133
...@@ -54,7 +54,7 @@ public interface GoodsInfoDao { ...@@ -54,7 +54,7 @@ public interface GoodsInfoDao {
void batchUpdateMallProductSku(List<Integer> delIds); void batchUpdateMallProductSku(List<Integer> delIds);
void batchUpdateMallProdSkuInfo(List<MallProdInfoDO> mallProdSkuInfoList); void batchUpdateMallProdSkuInfo(List<MallProdInfoDO> list);
List<MallIndustrySkuInfoDO> getMallIndustrySkuInfo(Integer id); List<MallIndustrySkuInfoDO> getMallIndustrySkuInfo(Integer id);
...@@ -110,4 +110,6 @@ public interface GoodsInfoDao { ...@@ -110,4 +110,6 @@ public interface GoodsInfoDao {
List<SpecPriceVO> getPriceBySpecId(Integer productSpecId, Integer leaseTerm); List<SpecPriceVO> getPriceBySpecId(Integer productSpecId, Integer leaseTerm);
int countGoodsInfoByCategoryId(Integer id); int countGoodsInfoByCategoryId(Integer id);
void updateMallProdSkuInfo(MallProdInfoDO mallProdInfoDO);
} }
...@@ -424,7 +424,10 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -424,7 +424,10 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
// 1.3批量修改sku的信息 // 1.3批量修改sku的信息
goodsInfoDao.batchUpdateMallProdSkuInfo(mallProdSkuInfoList); for (MallProdInfoDO mallProdInfoDO : mallProdSkuInfoList) {
goodsInfoDao.updateMallProdSkuInfo(mallProdInfoDO);
}
// goodsInfoDao.batchUpdateMallProdSkuInfo(mallProdSkuInfoList);
// 1.4对新的sku进行操作 // 1.4对新的sku进行操作
List<GoodsProdSpecVO> list = List<GoodsProdSpecVO> list =
specInfo.stream().filter(d -> d.getId() == null).collect(Collectors.toList()); specInfo.stream().filter(d -> d.getId() == null).collect(Collectors.toList());
...@@ -508,7 +511,10 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -508,7 +511,10 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
// 批量修改sku的信息 // 批量修改sku的信息
goodsInfoDao.batchUpdateMallProdSkuInfo(zdySpecList); for (MallProdInfoDO mallProdInfoDO : zdySpecList) {
goodsInfoDao.updateMallProdSkuInfo(mallProdInfoDO);
}
// goodsInfoDao.batchUpdateMallProdSkuInfo(zdySpecList);
} }
for (GoodsProdSpecVO goodsSpecVO : zdySpec) { for (GoodsProdSpecVO goodsSpecVO : zdySpec) {
// 【1】获取输入的自定义规格信息// id不为空则修改 // 【1】获取输入的自定义规格信息// id不为空则修改
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
where goods_info_id = #{goodsId} where goods_info_id = #{goodsId}
</update> </update>
<update id="batchUpdateMallProductSku"> <update id="batchUpdateMallProductSku">
<foreach collection="list" item="d" separator=";"> <foreach collection="list" item="d" separator=";" index="index">
update mall_prod_info update mall_prod_info
set is_deleted = 1 set is_deleted = 1
where id = #{d} where id = #{d}
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
</foreach> </foreach>
</update> </update>
<update id="batchUpdateMallProdSkuInfo"> <update id="batchUpdateMallProdSkuInfo">
<foreach collection="list" item="d" separator=";"> <foreach collection="list" item="d" separator=";" index="index">
update mall_prod_info update mall_prod_info
<set> <set>
product_id = #{d.prodSkuId}, product_id = #{d.prodSkuId},
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
</foreach> </foreach>
</update> </update>
<update id="batchUpdateMallProSpec"> <update id="batchUpdateMallProSpec">
<foreach collection="list" separator=";" item="d"> <foreach collection="list" separator=";" item="d" index="index">
update mall_prod_info_spec update mall_prod_info_spec
set is_deleted = 1 set is_deleted = 1
where mall_prod_info_id = #{d} where mall_prod_info_id = #{d}
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
</foreach> </foreach>
</update> </update>
<update id="batchUpdateMallProdSpec"> <update id="batchUpdateMallProdSpec">
<foreach collection="list" item="d" separator=";"> <foreach collection="list" item="d" separator=";" index="index">
update mall_prod_info_spec update mall_prod_info_spec
set is_deleted = 1 set is_deleted = 1
where id = #{d} where id = #{d}
...@@ -161,6 +161,16 @@ ...@@ -161,6 +161,16 @@
#{item} #{item}
</foreach> </foreach>
</update> </update>
<update id="updateMallProdSkuInfo">
update mall_prod_info
set product_id = #{prodSkuId},
categories_id = #{categoriesId},
prod_spec_name = #{prodSkuSpecName},
choose_type = #{chooseType},
sku_unit_id = #{skuUnitId},
is_must = #{must}
where id = #{id}
</update>
<delete id="deleteGoodsServiceByGoodsId"> <delete id="deleteGoodsServiceByGoodsId">
delete delete
from goods_service from goods_service
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论