|
@@ -329,7 +329,6 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements SkuSe
|
|
|
public void replacePackagingMaterial(ReplacePackagingMaterialDto dto) {
|
|
|
|
|
|
IWrapper<Object> wrapper = IWrapper.getWrapper()
|
|
|
- .eq("sslt", SkuSpecLink::getType, 1)
|
|
|
.eq("s", Sku::getCode, dto.getSkuCode())
|
|
|
.like("ss", SkuSpec::getCode, dto.getSkuSpecCode())
|
|
|
.eq("bs", BomSpec::getCode, dto.getBomSpecCode())
|
|
@@ -346,7 +345,7 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements SkuSe
|
|
|
List<Long> skuSpecIdList = list.stream().map(ReplacePackagingMaterialVo::getSkuSpecId).collect(Collectors.toList());
|
|
|
|
|
|
List<SkuSpecLink> skuSpecLinkList = skuSpecLinkService.list(q ->
|
|
|
- q.in(SkuSpecLink::getSkuSpecId, skuSpecIdList).eq(SkuSpecLink::getType, 1));
|
|
|
+ q.in(SkuSpecLink::getSkuSpecId, skuSpecIdList));
|
|
|
|
|
|
Map<Long, List<SkuSpecLink>> map = skuSpecLinkList.stream().collect(Collectors.groupingBy(SkuSpecLink::getSkuSpecId));
|
|
|
|
|
@@ -361,6 +360,10 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements SkuSe
|
|
|
if (replaceBomSpecBo == null) {
|
|
|
throw new ServiceException("没有找到替换包材bom规格");
|
|
|
}
|
|
|
+ Integer type = 1;
|
|
|
+ if (Objects.equals(replaceBomSpecBo.getClassifyId(), 1682221528948760578L)) {
|
|
|
+ type = 2;
|
|
|
+ }
|
|
|
|
|
|
List<SkuSpecLink> addOrEditSkuSpecLinkList = new ArrayList<>();
|
|
|
List<Long> removeSkuSpecLinkIdList = new ArrayList<>();
|
|
@@ -373,7 +376,7 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements SkuSe
|
|
|
skuSpecLink.setSkuId(record.getSkuId());
|
|
|
skuSpecLink.setSkuSpecId(record.getSkuSpecId());
|
|
|
skuSpecLink.setBomSpecId(replaceBomSpecId);
|
|
|
- skuSpecLink.setType(1);
|
|
|
+ skuSpecLink.setType(type);
|
|
|
skuSpecLink.setQuantity(BigDecimal.ONE);
|
|
|
addOrEditSkuSpecLinkList.add(skuSpecLink);
|
|
|
continue;
|
|
@@ -404,7 +407,7 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements SkuSe
|
|
|
skuSpecLink.setSkuId(record.getSkuId());
|
|
|
skuSpecLink.setSkuSpecId(record.getSkuSpecId());
|
|
|
skuSpecLink.setBomSpecId(replaceBomSpecId);
|
|
|
- skuSpecLink.setType(1);
|
|
|
+ skuSpecLink.setType(type);
|
|
|
skuSpecLink.setQuantity(BigDecimal.ONE);
|
|
|
addOrEditSkuSpecLinkList.add(skuSpecLink);
|
|
|
}
|