|
@@ -1701,6 +1701,7 @@ public class ProductServiceImpl implements ProductService { |
|
@@ -1701,6 +1701,7 @@ public class ProductServiceImpl implements ProductService { |
1701
|
|
1701
|
|
1702
|
//校验sizeId
|
1702
|
//校验sizeId
|
1703
|
String[] sizeIdArr = sizeIds.split(",");
|
1703
|
String[] sizeIdArr = sizeIds.split(",");
|
|
|
1704
|
+ List<Integer> sizeIdList = buildSizeIdList(sizeIdArr);
|
1704
|
List<SelfSize> needAddRecordList = Lists.newArrayList();
|
1705
|
List<SelfSize> needAddRecordList = Lists.newArrayList();
|
1705
|
List<SelfSizeUid> needRelateUidList = Lists.newArrayList();
|
1706
|
List<SelfSizeUid> needRelateUidList = Lists.newArrayList();
|
1706
|
|
1707
|
|
|
@@ -1709,14 +1710,14 @@ public class ProductServiceImpl implements ProductService { |
|
@@ -1709,14 +1710,14 @@ public class ProductServiceImpl implements ProductService { |
1709
|
List<Integer> existSizeIdList = storageList.stream().map(Storage::getSizeId).collect(Collectors.toList());
|
1710
|
List<Integer> existSizeIdList = storageList.stream().map(Storage::getSizeId).collect(Collectors.toList());
|
1710
|
List<Size> sizeList = sizeMapper.selectByIds(existSizeIdList);
|
1711
|
List<Size> sizeList = sizeMapper.selectByIds(existSizeIdList);
|
1711
|
Map<Integer, String> sizeIdNameMap = sizeList.stream().collect(Collectors.toMap(Size::getId, Size::getSizeName));
|
1712
|
Map<Integer, String> sizeIdNameMap = sizeList.stream().collect(Collectors.toMap(Size::getId, Size::getSizeName));
|
1712
|
- List<SelfSize> existRecordList = selfSizeMapper.selectByProductIdAndSizeId(productId, sizeIds);
|
1713
|
+ List<SelfSize> existRecordList = selfSizeMapper.selectByProductIdAndSizeId(productId, sizeIdList);
|
1713
|
Map<Integer, SelfSize> selfSizeMap = existRecordList.stream().collect(Collectors.toMap(SelfSize::getSizeId, s->s));
|
1714
|
Map<Integer, SelfSize> selfSizeMap = existRecordList.stream().collect(Collectors.toMap(SelfSize::getSizeId, s->s));
|
1714
|
if(MapUtils.isEmpty(selfSizeMap)) {
|
1715
|
if(MapUtils.isEmpty(selfSizeMap)) {
|
1715
|
selfSizeMap = Maps.newHashMap();
|
1716
|
selfSizeMap = Maps.newHashMap();
|
1716
|
}
|
1717
|
}
|
1717
|
|
1718
|
|
1718
|
//自助尺码uid关联表
|
1719
|
//自助尺码uid关联表
|
1719
|
- List<SelfSizeUid> selfSizeUidList = selfSizeUidMapper.selectByProductIdAndSizeId(productId, sizeIds);
|
1720
|
+ List<SelfSizeUid> selfSizeUidList = selfSizeUidMapper.selectByProductIdAndSizeId(productId, sizeIdList);
|
1720
|
Map<Integer, List<SelfSizeUid>> sizeIdUidMap = selfSizeUidList.stream().collect(Collectors.groupingBy(SelfSizeUid::getSizeId));
|
1721
|
Map<Integer, List<SelfSizeUid>> sizeIdUidMap = selfSizeUidList.stream().collect(Collectors.groupingBy(SelfSizeUid::getSizeId));
|
1721
|
|
1722
|
|
1722
|
List<String> warnSizeNameList = Lists.newArrayList();
|
1723
|
List<String> warnSizeNameList = Lists.newArrayList();
|
|
@@ -1772,6 +1773,15 @@ public class ProductServiceImpl implements ProductService { |
|
@@ -1772,6 +1773,15 @@ public class ProductServiceImpl implements ProductService { |
1772
|
|
1773
|
|
1773
|
}
|
1774
|
}
|
1774
|
|
1775
|
|
|
|
1776
|
+ private List<Integer> buildSizeIdList(String[] sizeIdArr){
|
|
|
1777
|
+ List<Integer> sizeIdList = Lists.newArrayList();
|
|
|
1778
|
+ for(int i=0; i<sizeIdArr.length; i++) {
|
|
|
1779
|
+ sizeIdList.add(Integer.parseInt(sizeIdArr[i]));
|
|
|
1780
|
+ }
|
|
|
1781
|
+ return sizeIdList;
|
|
|
1782
|
+ }
|
|
|
1783
|
+
|
|
|
1784
|
+
|
1775
|
private String getGoodsDeafultImage(Integer goodsId) {
|
1785
|
private String getGoodsDeafultImage(Integer goodsId) {
|
1776
|
List<GoodsImages> goodsImages = goodsImagesMapper.selectByGoodsId(goodsId);
|
1786
|
List<GoodsImages> goodsImages = goodsImagesMapper.selectByGoodsId(goodsId);
|
1777
|
String defaultYImage = null;
|
1787
|
String defaultYImage = null;
|