|
@@ -6,7 +6,6 @@ import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|
import com.citu.framework.common.pojo.PageParam;
|
|
import com.citu.framework.common.pojo.PageParam;
|
|
import com.citu.framework.common.pojo.PageResult;
|
|
import com.citu.framework.common.pojo.PageResult;
|
|
import com.citu.framework.common.util.object.BeanUtils;
|
|
import com.citu.framework.common.util.object.BeanUtils;
|
|
-import com.citu.framework.common.util.object.ObjectUtils;
|
|
|
|
import com.citu.framework.datapermission.core.annotation.DataPermission;
|
|
import com.citu.framework.datapermission.core.annotation.DataPermission;
|
|
import com.citu.framework.dict.core.DictFrameworkUtils;
|
|
import com.citu.framework.dict.core.DictFrameworkUtils;
|
|
import com.citu.module.menduner.common.dto.TimeRangeBaseReqVO;
|
|
import com.citu.module.menduner.common.dto.TimeRangeBaseReqVO;
|
|
@@ -39,6 +38,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.util.StringUtils;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -151,7 +151,7 @@ public class EnterpriseServiceImpl implements EnterpriseService {
|
|
PageResult<EnterpriseDetailRespVO> result = enterpriseMapper.page(pageReqVO);
|
|
PageResult<EnterpriseDetailRespVO> result = enterpriseMapper.page(pageReqVO);
|
|
result.getList().forEach(item -> {
|
|
result.getList().forEach(item -> {
|
|
List<EnterpriseAddressDO> addressList = addressService.getEnterpriseAddressList(item.getId());
|
|
List<EnterpriseAddressDO> addressList = addressService.getEnterpriseAddressList(item.getId());
|
|
- if(ObjectUtil.isNotEmpty(addressList)) {
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(addressList)) {
|
|
item.setAddressList(BeanUtils.toBean(addressList, EnterpriseAddressRespVO.class));
|
|
item.setAddressList(BeanUtils.toBean(addressList, EnterpriseAddressRespVO.class));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -297,22 +297,25 @@ public class EnterpriseServiceImpl implements EnterpriseService {
|
|
@Override
|
|
@Override
|
|
public List<AppEnterpriseDetailRespVO> getEnterpriseDetails(String ids) {
|
|
public List<AppEnterpriseDetailRespVO> getEnterpriseDetails(String ids) {
|
|
List<AppEnterpriseDetailRespVO> appEnterpriseDetailRespVOS = new ArrayList<>();
|
|
List<AppEnterpriseDetailRespVO> appEnterpriseDetailRespVOS = new ArrayList<>();
|
|
- List<Long> enterprideIds = Arrays.asList(ids.split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
|
|
|
|
- if (enterprideIds.isEmpty()) {
|
|
|
|
|
|
+ List<Long> enterpriseIds = Arrays.stream(ids.split(","))
|
|
|
|
+ .filter(StringUtils::hasText)
|
|
|
|
+ .map(Long::parseLong)
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ if (enterpriseIds.isEmpty()) {
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
}
|
|
}
|
|
- List<EnterpriseDO> enterprise = enterpriseMapper.selectBatchIds(enterprideIds);
|
|
|
|
- List<EnterpriseBusinessDO> business = enterpriseBusinessMapper.selectByEnterpriseIds(enterprideIds);
|
|
|
|
- List<EnterpriseAddressDO> addresseList = enterpriseAddressMapper.selectByEnterpriseId(enterprideIds);
|
|
|
|
|
|
+ List<EnterpriseDO> enterprise = enterpriseMapper.selectBatchIds(enterpriseIds);
|
|
|
|
+ List<EnterpriseBusinessDO> business = enterpriseBusinessMapper.selectByEnterpriseIds(enterpriseIds);
|
|
|
|
+ List<EnterpriseAddressDO> addresseList = enterpriseAddressMapper.selectByEnterpriseId(enterpriseIds);
|
|
Map<Long, EnterpriseBusinessDO> enterpriseBusinessDOMap = business.stream()
|
|
Map<Long, EnterpriseBusinessDO> enterpriseBusinessDOMap = business.stream()
|
|
- .collect(Collectors.toMap(item -> item.getEnterpriseId(), item -> item));
|
|
|
|
|
|
+ .collect(Collectors.toMap(EnterpriseBusinessDO::getEnterpriseId, item -> item));
|
|
Map<Long, List<EnterpriseAddressDO>> addresseListMap = new HashMap<>();
|
|
Map<Long, List<EnterpriseAddressDO>> addresseListMap = new HashMap<>();
|
|
for (EnterpriseAddressDO enterpriseAddressDO : addresseList) {
|
|
for (EnterpriseAddressDO enterpriseAddressDO : addresseList) {
|
|
List<EnterpriseAddressDO> orDefault = addresseListMap.getOrDefault(enterpriseAddressDO.getEnterpriseId(), new ArrayList<>());
|
|
List<EnterpriseAddressDO> orDefault = addresseListMap.getOrDefault(enterpriseAddressDO.getEnterpriseId(), new ArrayList<>());
|
|
orDefault.add(enterpriseAddressDO);
|
|
orDefault.add(enterpriseAddressDO);
|
|
addresseListMap.put(enterpriseAddressDO.getEnterpriseId(), orDefault);
|
|
addresseListMap.put(enterpriseAddressDO.getEnterpriseId(), orDefault);
|
|
}
|
|
}
|
|
- Set<Long> industrysIds = new HashSet<>();
|
|
|
|
|
|
+ Set<Long> industryIds = new HashSet<>();
|
|
for (EnterpriseDO enterpriseDO : enterprise) {
|
|
for (EnterpriseDO enterpriseDO : enterprise) {
|
|
AppEnterpriseDetailRespVO respVO = new AppEnterpriseDetailRespVO();
|
|
AppEnterpriseDetailRespVO respVO = new AppEnterpriseDetailRespVO();
|
|
respVO.setEnterprise(EnterpriseConvert.INSTANCE.convert3(enterpriseDO));
|
|
respVO.setEnterprise(EnterpriseConvert.INSTANCE.convert3(enterpriseDO));
|
|
@@ -321,10 +324,10 @@ public class EnterpriseServiceImpl implements EnterpriseService {
|
|
if (null != respVO.getEnterprise().getScale()) {
|
|
if (null != respVO.getEnterprise().getScale()) {
|
|
respVO.getEnterprise().setScaleName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.MENDUNER_SCALE, respVO.getEnterprise().getScale()));
|
|
respVO.getEnterprise().setScaleName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.MENDUNER_SCALE, respVO.getEnterprise().getScale()));
|
|
}
|
|
}
|
|
- industrysIds.add(enterpriseDO.getIndustryId());
|
|
|
|
|
|
+ industryIds.add(enterpriseDO.getIndustryId());
|
|
appEnterpriseDetailRespVOS.add(respVO);
|
|
appEnterpriseDetailRespVOS.add(respVO);
|
|
}
|
|
}
|
|
- Map<Long, String> map = industryService.getIndustryTitleByIds(industrysIds);
|
|
|
|
|
|
+ Map<Long, String> map = industryService.getIndustryTitleByIds(industryIds);
|
|
appEnterpriseDetailRespVOS.forEach(item -> item.getEnterprise().setIndustryName(map.get(item.getEnterprise().getIndustryId())));
|
|
appEnterpriseDetailRespVOS.forEach(item -> item.getEnterprise().setIndustryName(map.get(item.getEnterprise().getIndustryId())));
|
|
|
|
|
|
return appEnterpriseDetailRespVOS;
|
|
return appEnterpriseDetailRespVOS;
|