|
@@ -1420,9 +1420,11 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
List<Long> specAttrIds = goodsSpecAttributeService.getIdsByTenant(specIds);
|
|
|
if (CollectionUtils.isNotEmpty(specAttrIds)){
|
|
|
goodsSpecAttributeService.deleteByIdsTenant(specAttrIds);
|
|
|
+ iSysGoodsCopyRecordService.deleteByTenantId(specAttrIds,GoodsCopyEnum.GOODS_SPEC_ATTRIBUTE.getType(),newTenantId);
|
|
|
goodsSpecAttributeRelationService.deleteByTemplateIdTenant(newSpecTemplateId,newTenantId);
|
|
|
}
|
|
|
goodsSpecService.deleteByIdsTenant(specIds);
|
|
|
+ iSysGoodsCopyRecordService.deleteByTenantId(specIds,GoodsCopyEnum.GOODS_SPEC.getType(),newTenantId);
|
|
|
}
|
|
|
}else {
|
|
|
//新增
|
|
@@ -1451,10 +1453,10 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
.eq(GoodsSpecAttribute::getSpecId, oldSpecId));
|
|
|
if (CollectionUtils.isNotEmpty(specAttributeList)){
|
|
|
List<GoodsSpecAttribute> collect = specAttributeList.stream().map(attrItem -> {
|
|
|
+ attrItem.setOId(attrItem.getSpecAttributeId());
|
|
|
attrItem.setSpecAttributeId(null);
|
|
|
attrItem.setSpecId(item.getSpecId());
|
|
|
attrItem.setTenantId(newTenantId);
|
|
|
- attrItem.setOId(attrItem.getSpecAttributeId());
|
|
|
return attrItem;
|
|
|
}).collect(Collectors.toList());
|
|
|
goodsSpecAttributeService.saveBatch(collect);
|
|
@@ -1501,6 +1503,11 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(recordList)){
|
|
|
+ //保存记录
|
|
|
+ iSysGoodsCopyRecordService.saveBatch(recordList);
|
|
|
+ }
|
|
|
+
|
|
|
//规格模板商品重新绑定
|
|
|
if (CollectionUtils.isNotEmpty(newRelationList)){
|
|
|
for (GoodsSpecAttributeRelation relation : newRelationList) {
|
|
@@ -1553,10 +1560,6 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
goodsSpecAttributeRelationService.saveBatch(newRelationList);
|
|
|
}
|
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(recordList)){
|
|
|
- //保存记录
|
|
|
- iSysGoodsCopyRecordService.saveBatch(recordList);
|
|
|
- }
|
|
|
redisCache.deleteObject(key);
|
|
|
}catch (Exception e){
|
|
|
//释放
|