From a75f9ca4309397d86b6141e99fb4c480e2a3a35a Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Thu, 30 May 2024 18:44:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E4=BF=AE=E6=94=B9=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E4=BD=93=E7=B3=BB=E5=AF=BC=E5=85=A5=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 修改价格体系导入提示错误问题 2 修改删除客户信息时同时删除客户品牌的关系 --- .../basicdata/mapper/BasicdataPriceMapper.xml | 2 +- .../impl/BasicdataClientServiceImpl.java | 37 +++++++++++++++++-- .../impl/BasicdataPriceServiceImpl.java | 8 +++- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml index 50d0253cd..59f3b1b27 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml @@ -29,7 +29,7 @@ and lbsb.brand_id = t.brand_id and t.effective_time now() and t.expiry_time >= now() left join logpm_basicdata_brand ldb on ldb.id = lbsb.brand_id left join logpm_basicdata_price_template lbpt on t.template_id = lbpt.id - where lbsb.is_deleted = 0 + where lbsb.is_deleted = 0 and cli.is_deleted = 0 and cli.client_name like concat('%',#{basicdataPrice.clientName},'%') diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java index 0425b45ac..b593b718c 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java @@ -26,10 +26,26 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.logpm.basicdata.entity.*; +import com.logpm.basicdata.entity.BasicdataBrandEntity; +import com.logpm.basicdata.entity.BasicdataClientEntity; +import com.logpm.basicdata.entity.BasicdataHistoricalContractEntity; +import com.logpm.basicdata.entity.BasicdataStorageServicesEntity; +import com.logpm.basicdata.entity.BasicdataStoreBrandEntity; +import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity; +import com.logpm.basicdata.entity.BasicdataStoreContactEntity; +import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity; +import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.excel.BasicdataClientExcel; import com.logpm.basicdata.mapper.BasicdataClientMapper; -import com.logpm.basicdata.service.*; +import com.logpm.basicdata.service.IBasicdataBrandService; +import com.logpm.basicdata.service.IBasicdataClientService; +import com.logpm.basicdata.service.IBasicdataHistoricalContractService; +import com.logpm.basicdata.service.IBasicdataStorageServicesService; +import com.logpm.basicdata.service.IBasicdataStoreBrandService; +import com.logpm.basicdata.service.IBasicdataStoreBusinessService; +import com.logpm.basicdata.service.IBasicdataStoreContactService; +import com.logpm.basicdata.service.IBasicdataTripartiteMallService; +import com.logpm.basicdata.service.IBasicdataWarehouseService; import com.logpm.basicdata.vo.BasicdataClientVO; import com.logpm.basicdata.vo.ClientInfoVO; import lombok.extern.slf4j.Slf4j; @@ -49,7 +65,13 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.security.NoSuchAlgorithmException; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import static org.springblade.common.constant.DictBizConstant.OPEN_ORDER_PAY_WAY; @@ -242,15 +264,22 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl toLongList) { + List clientIds = new ArrayList<>(); toLongList.forEach(i -> { List basicdataClientEntities = baseMapper.selectList(Wrappers.query().lambda() .eq(BasicdataClientEntity::getPid, i) ); if (!basicdataClientEntities.isEmpty()) { baseMapper.deleteBatchIds(basicdataClientEntities); + clientIds.addAll(basicdataClientEntities.stream().map(BasicdataClientEntity::getId).collect(Collectors.toList())); } - + clientIds.add(i); }); + // 删除客户品牌关系 + if(CollUtil.isNotEmpty(clientIds)){ + basicdataStoreBrandService.remove(Wrappers.query().lambda() + .in(BasicdataStoreBrandEntity::getClientId, clientIds)); + } return this.deleteLogic(toLongList); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java index 0aff8b488..395ccf6d5 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java @@ -2492,7 +2492,11 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl generalExcels, Map clientEntityMap, Map priceEntityMap, Map provinceMap, Map provinceCityMap, Map provinceCityAearMap, StringBuilder message, String sheet5, Map clientBrandMap, Map templateMap) { + private void checkGeneralExcelsV2(List generalExcels, Map clientEntityMap, + Map priceEntityMap, Map provinceMap, + Map provinceCityMap, Map provinceCityAearMap, StringBuilder message, + String sheet5, Map clientBrandMap, Map templateMap) { if (CollUtil.isNotEmpty(generalExcels)) { for (int i = 0; i < generalExcels.size(); i++) { BasicdataPriceGeneralV2Excel excel = generalExcels.get(i); @@ -3461,7 +3465,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl