Sfoglia il codice sorgente

Merge branch 'release_toaliyun_real_20230605' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real_20230605

release_toaliyun_real
lin 2 anni fa
parent
commit
e800cd1983
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. +3
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantRelationServiceImpl.java

+ 3
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantRelationServiceImpl.java Vedi File

@@ -45,7 +45,7 @@ public class WxMerchantRelationServiceImpl implements WxMerchantRelationService
List<WxMerchantRelation> infByIds = wxMerchantRelationMapper.getInfByIds(ids); List<WxMerchantRelation> infByIds = wxMerchantRelationMapper.getInfByIds(ids);
List<Long> updateList = new ArrayList<>(); List<Long> updateList = new ArrayList<>();
if (!CollectionUtils.isEmpty(infByIds)) { if (!CollectionUtils.isEmpty(infByIds)) {
List<Long> alreadyList = infByIds.parallelStream().filter(x -> x.getIsDel() == 0).map(WxMerchantRelation::getMerchantId).collect(Collectors.toList());
List<Long> alreadyList = infByIds.parallelStream().filter(x -> x.getIsDel() == 0 && !ids.contains(x.getMerchantId())).map(WxMerchantRelation::getMerchantId).collect(Collectors.toList());
//如果已经存在就返回 //如果已经存在就返回
if (!CollectionUtils.isEmpty(alreadyList)){ if (!CollectionUtils.isEmpty(alreadyList)){
return new ResultData(Result.ERROR, "存在子商户在其他区域商户下"); return new ResultData(Result.ERROR, "存在子商户在其他区域商户下");
@@ -58,7 +58,8 @@ public class WxMerchantRelationServiceImpl implements WxMerchantRelationService
} }


List<Long> finalList = updateList; List<Long> finalList = updateList;
List<Long> insertList = ids.parallelStream().filter(x -> !finalList.contains(x)).collect(Collectors.toList());
List<Long> alreadyList = infByIds.parallelStream().filter(x -> x.getIsDel() == 0).map(WxMerchantRelation::getMerchantId).collect(Collectors.toList());
List<Long> insertList = ids.parallelStream().filter(x -> !finalList.contains(x) && !alreadyList.contains(x)).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(updateList)) { if (!CollectionUtils.isEmpty(updateList)) {
wxMerchantRelationMapper.updateByMerchantIds(updateList,regionId); wxMerchantRelationMapper.updateByMerchantIds(updateList,regionId);
} }


Caricamento…
Annulla
Salva