|
@@ -58,12 +58,12 @@ public class CmsGoodsDonSkuServiceImpl extends ServiceImpl<GoodsDonSkuMapper,Goo
|
|
|
Map<Long, GoodsDiscountPlusPurchaseRelation> skuIdMap = new ConcurrentHashMap<>();
|
|
Map<Long, GoodsDiscountPlusPurchaseRelation> skuIdMap = new ConcurrentHashMap<>();
|
|
|
discountPlusPurchaseGoods.forEach(discountGoods -> {
|
|
discountPlusPurchaseGoods.forEach(discountGoods -> {
|
|
|
AtomicBoolean is_exist = new AtomicBoolean(false);
|
|
AtomicBoolean is_exist = new AtomicBoolean(false);
|
|
|
- if (skuIdMap.get(discountGoods.getDisGid()) == null) {
|
|
|
|
|
- skuIdMap.put(discountGoods.getDisGid(), discountGoods);
|
|
|
|
|
|
|
+ if (skuIdMap.get(discountGoods.getDisSid()) == null) {
|
|
|
|
|
+ skuIdMap.put(discountGoods.getDisSid(), discountGoods);
|
|
|
}
|
|
}
|
|
|
dbDiscountPlusGoodsList.forEach(db_exist->{
|
|
dbDiscountPlusGoodsList.forEach(db_exist->{
|
|
|
//存在
|
|
//存在
|
|
|
- if (db_exist.getDisGid().equals(discountGoods.getDisGid())) {
|
|
|
|
|
|
|
+ if (db_exist.getDisSid().equals(discountGoods.getDisSid())) {
|
|
|
is_exist.set(true);
|
|
is_exist.set(true);
|
|
|
discountGoods.setId(db_exist.getId());
|
|
discountGoods.setId(db_exist.getId());
|
|
|
checkPurchaseParamsAndSaveOrUpdate(goodsId, skuId, discountGoods);
|
|
checkPurchaseParamsAndSaveOrUpdate(goodsId, skuId, discountGoods);
|
|
@@ -77,7 +77,7 @@ public class CmsGoodsDonSkuServiceImpl extends ServiceImpl<GoodsDonSkuMapper,Goo
|
|
|
|
|
|
|
|
//去除数据库已被删除的
|
|
//去除数据库已被删除的
|
|
|
dbDiscountPlusGoodsList.forEach(dbDiscountPlusGoods -> {
|
|
dbDiscountPlusGoodsList.forEach(dbDiscountPlusGoods -> {
|
|
|
- GoodsDiscountPlusPurchaseRelation exists = skuIdMap.get(dbDiscountPlusGoods.getDisGid());
|
|
|
|
|
|
|
+ GoodsDiscountPlusPurchaseRelation exists = skuIdMap.get(dbDiscountPlusGoods.getDisSid());
|
|
|
//不存在
|
|
//不存在
|
|
|
if (exists == null) {
|
|
if (exists == null) {
|
|
|
discountPlusPurchaseRelationMapper.deleteById(dbDiscountPlusGoods.getId());
|
|
discountPlusPurchaseRelationMapper.deleteById(dbDiscountPlusGoods.getId());
|