Browse Source

feat(all): 修改价格体系导入提示错误问题

1 修改价格体系导入提示错误问题
2 修改删除客户信息时同时删除客户品牌的关系
dist.1.3.0
zhaoqiaobo 8 months ago
parent
commit
a75f9ca430
  1. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml
  2. 37
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  3. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java

2
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 <![CDATA[ <= ]]> 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
<if test="basicdataPrice.clientName != null and basicdataPrice.clientName != ''">
and cli.client_name like concat('%',#{basicdataPrice.clientName},'%')
</if>

37
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<BasicdataClientM
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean ownDeleteLogic(List<Long> toLongList) {
List<Long> clientIds = new ArrayList<>();
toLongList.forEach(i -> {
List<BasicdataClientEntity> basicdataClientEntities = baseMapper.selectList(Wrappers.<BasicdataClientEntity>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.<BasicdataStoreBrandEntity>query().lambda()
.in(BasicdataStoreBrandEntity::getClientId, clientIds));
}
return this.deleteLogic(toLongList);
}

8
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java

@ -2492,7 +2492,11 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
}
}
private void checkGeneralExcelsV2(List<BasicdataPriceGeneralV2Excel> generalExcels, Map<String, BasicdataClientEntity> clientEntityMap, Map<String, BasicdataPriceEntity> priceEntityMap, Map<String, String> provinceMap, Map<String, String> provinceCityMap, Map<String, String> provinceCityAearMap, StringBuilder message, String sheet5, Map<String, BasicdataStoreBrandEntity> clientBrandMap, Map<String, BasicdataPriceTemplateEntity> templateMap) {
private void checkGeneralExcelsV2(List<BasicdataPriceGeneralV2Excel> generalExcels, Map<String, BasicdataClientEntity> clientEntityMap,
Map<String, BasicdataPriceEntity> priceEntityMap, Map<String, String> provinceMap,
Map<String, String> provinceCityMap, Map<String, String> provinceCityAearMap, StringBuilder message,
String sheet5, Map<String, BasicdataStoreBrandEntity> clientBrandMap, Map<String,
BasicdataPriceTemplateEntity> 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<BasicdataPriceMap
buildErrorMessageExcel(message, rowMessage, firstMessage);
}
if (StrUtil.isEmpty(message.toString())) {
if (CollUtil.isNotEmpty(priceEntityMap) && !ObjectUtil.equal(priceExcels.size(), priceEntityMap.size())) {
if (CollUtil.isNotEmpty(priceEntityMap) && !ObjectUtil.equal(priceExcels.size(), clientBrandMap.size())) {
message.append(sheet1).append("中存在 客户名称+品牌 重复的数据,请检查;");
}
}

Loading…
Cancel
Save