| @@ -55,19 +55,15 @@ public class WxMerchantRelationServiceImpl implements WxMerchantRelationService | |||||
| List<Long> finalList = list; | List<Long> finalList = list; | ||||
| List<Long> collected = ids.parallelStream().filter(x -> !finalList.contains(x)).collect(Collectors.toList()); | List<Long> collected = ids.parallelStream().filter(x -> !finalList.contains(x)).collect(Collectors.toList()); | ||||
| //1-新增 2-修改 | |||||
| if (type == 1) { | |||||
| //选择就插入 | |||||
| insertInfo(regionId, ids, tenantId); | |||||
| return new ResultData(Result.SUCCESS, "新增成功", null); | |||||
| } else if (type == 2) { | |||||
| if (!CollectionUtils.isEmpty(list)) { | |||||
| wxMerchantRelationMapper.updateByMerchantIds(list); | wxMerchantRelationMapper.updateByMerchantIds(list); | ||||
| if (!CollectionUtils.isEmpty(collected)){ | |||||
| insertInfo(regionId, collected, tenantId); | |||||
| } | |||||
| return new ResultData(Result.SUCCESS, "编辑成功", null); | |||||
| } | } | ||||
| return null; | |||||
| if (!CollectionUtils.isEmpty(collected)) { | |||||
| insertInfo(regionId, collected, tenantId); | |||||
| } | |||||
| return new ResultData(Result.SUCCESS, "编辑成功", null); | |||||
| } | } | ||||
| public void insertInfo(Long regionId, List<Long> ids, String tenantId) { | public void insertInfo(Long regionId, List<Long> ids, String tenantId) { | ||||
| @@ -77,7 +73,6 @@ public class WxMerchantRelationServiceImpl implements WxMerchantRelationService | |||||
| relation.setId(IdWorker.get().nextId()); | relation.setId(IdWorker.get().nextId()); | ||||
| relation.setMerchantId(id); | relation.setMerchantId(id); | ||||
| relation.setRegionMerchantId(regionId); | relation.setRegionMerchantId(regionId); | ||||
| relation.setIsDel(0); | |||||
| relation.setTenantId(tenantId); | relation.setTenantId(tenantId); | ||||
| list.add(relation); | list.add(relation); | ||||
| } | } | ||||