提交 7f6a4aa4 作者: xiaowang

编辑修复

上级 34f925a8
package com.mmc.pms.entity; package com.mmc.pms.entity;
import com.mmc.pms.model.categories.dto.CategoriesInfoListDTO; import com.mmc.pms.model.categories.dto.CategoriesInfoListDTO;
import com.mmc.pms.model.categories.dto.ClassifyDetailsDTO; import com.mmc.pms.model.categories.dto.ClassifyDetailsDTO;
import com.mmc.pms.model.categories.dto.ClassifyInfoDTO; import com.mmc.pms.model.categories.dto.ClassifyInfoDTO;
...@@ -13,61 +12,70 @@ import java.io.Serializable; ...@@ -13,61 +12,70 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* @author lw * @author lw @TableName categories
* @TableName categories
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class Categories implements Serializable { public class Categories implements Serializable {
private Integer id; private Integer id;
private Integer parentId; private Integer parentId;
private String name; private String name;
private String icon; private String icon;
private String description; private String description;
private Integer sort; private Integer sort;
private Integer type; private Integer type;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
private Integer deleted; private Integer deleted;
private Integer directoryId; private Integer directoryId;
private String remark; private String remark;
public Categories(ClassifyInfoVO classifyInfoVO) { public Categories(ClassifyInfoVO classifyInfoVO) {
this.id = classifyInfoVO.getId(); this.id = classifyInfoVO.getId();
this.parentId = classifyInfoVO.getPid(); this.parentId = classifyInfoVO.getPid();
this.name = classifyInfoVO.getClassifyName(); this.name = classifyInfoVO.getClassifyName();
this.icon = classifyInfoVO.getIcon(); this.icon = classifyInfoVO.getIcon();
this.description = classifyInfoVO.getDescription(); this.description = classifyInfoVO.getDescription();
this.type = classifyInfoVO.getType(); this.type = classifyInfoVO.getType();
this.directoryId = classifyInfoVO.getDirectoryId(); this.directoryId = classifyInfoVO.getDirectoryId();
this.remark = classifyInfoVO.getRemark(); this.remark = classifyInfoVO.getRemark();
} }
public ClassifyInfoDTO buildClassifyInfoDTO() { public ClassifyInfoDTO buildClassifyInfoDTO() {
return ClassifyInfoDTO.builder().id(id).description(description) return ClassifyInfoDTO.builder()
.icon(icon).pid(parentId).classifyName(name) .id(id)
.remark(remark).createTime(createTime) .description(description)
.directoryId(directoryId).type(type).build(); .icon(icon)
} .pid(parentId)
.classifyName(name)
.remark(remark)
public ClassifyDetailsDTO buildClassifyDetailsDTO() { .createTime(createTime)
return ClassifyDetailsDTO.builder().id(id).description(description) .directoryId(directoryId)
.icon(icon).classifyName(name) .type(type)
.remark(remark).build(); .build();
} }
public CategoriesInfoListDTO buildCategoriesInfoListDTO() { public ClassifyDetailsDTO buildClassifyDetailsDTO() {
return CategoriesInfoListDTO.builder().id(id).icon(icon).directoryId(directoryId).name(name).build(); return ClassifyDetailsDTO.builder()
} .id(id)
} .description(description)
\ No newline at end of file .icon(icon)
.classifyName(name)
.remark(remark)
.build();
}
public CategoriesInfoListDTO buildCategoriesInfoListDTO() {
return CategoriesInfoListDTO.builder().id(id).icon(icon).name(name).build();
}
}
/** /** Copyright 2023 bejson.com */
* Copyright 2023 bejson.com
*/
package com.mmc.pms.model.categories.dto; package com.mmc.pms.model.categories.dto;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -19,8 +17,8 @@ import lombok.NoArgsConstructor; ...@@ -19,8 +17,8 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class CategoriesInfoListDTO { public class CategoriesInfoListDTO {
private Integer id; private Integer id;
private Integer directoryId; private Integer directoryId;
private String name; private String name;
private String icon; private String icon;
} }
\ No newline at end of file
...@@ -380,6 +380,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -380,6 +380,7 @@ 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);
// 1、普通的sku修改逻辑 // 1、普通的sku修改逻辑
List<GoodsProdSpecVO> specInfo = List<GoodsProdSpecVO> specInfo =
goodsAddVO.getProductSpec().stream() goodsAddVO.getProductSpec().stream()
...@@ -427,7 +428,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -427,7 +428,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
// 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());
productSkuSpecOperation(new GoodsInfo(goodsAddVO.getId()), list); productSkuSpecOperation(goodsInfo, list);
// 获取商品对应的skuId // 获取商品对应的skuId
List<Integer> mallSkuIds = List<Integer> mallSkuIds =
goodsAddVO.getProductSpec().stream() goodsAddVO.getProductSpec().stream()
...@@ -479,13 +480,13 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -479,13 +480,13 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
.filter(spec -> spec.getFlag().equals(1)) .filter(spec -> spec.getFlag().equals(1))
.collect(Collectors.toList()); .collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(zdySpecInfo)) { if (CollectionUtils.isNotEmpty(zdySpecInfo)) {
updateCustomize(zdySpecInfo, goodsAddVO.getId()); updateCustomize(goodsInfo, zdySpecInfo, goodsAddVO.getId());
} }
} }
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updateCustomize(List<GoodsProdSpecVO> zdySpecInfo, Integer id) { public void updateCustomize(GoodsInfo goodsInfo, List<GoodsProdSpecVO> zdySpecInfo, Integer id) {
// 先获取自定义的sku及规格(原来有的) // 先获取自定义的sku及规格(原来有的)
List<GoodsProdSpecVO> zdySpec = List<GoodsProdSpecVO> zdySpec =
...@@ -561,7 +562,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -561,7 +562,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
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());
if (CollectionUtils.isNotEmpty(newZdySpec)) { if (CollectionUtils.isNotEmpty(newZdySpec)) {
productSkuSpecOperation(new GoodsInfo(id), newZdySpec); productSkuSpecOperation(goodsInfo, newZdySpec);
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论