提交 7f6a4aa4 作者: xiaowang

编辑修复

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