|
|
@@ -24,6 +24,7 @@ import com.sckw.manage.model.vo.res.AddressQueryResVo;
|
|
|
import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -77,6 +78,19 @@ public class KwmAddressService {
|
|
|
return Collections.emptyList();
|
|
|
}
|
|
|
|
|
|
+ List<AddressQueryResVo> list = getAddressQueryResVo(kwmAddresses);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc: 转换成vo
|
|
|
+ * @param: kwmAddresses 实体
|
|
|
+ * @author: czh
|
|
|
+ * @date 2023/7/18
|
|
|
+ * @return AddressQueryResVo
|
|
|
+ */
|
|
|
+ private List<AddressQueryResVo> getAddressQueryResVo(List<KwmAddress> kwmAddresses) {
|
|
|
List<AddressQueryResVo> list = new ArrayList<>();
|
|
|
List<Long> userIds = kwmAddresses.stream().map(KwmAddress::getCreateBy).distinct().toList();
|
|
|
List<Long> types = kwmAddresses.stream().map(KwmAddress::getType).distinct().toList();
|
|
|
@@ -205,4 +219,22 @@ public class KwmAddressService {
|
|
|
throw new SystemException(HttpStatus.CODE_10301, HttpStatus.MSG_014);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc: 查企业下的地址
|
|
|
+ * @param: reqVo 企业id
|
|
|
+ * @author: czh
|
|
|
+ * @date 2023/7/18
|
|
|
+ * @return AddressQueryResVo
|
|
|
+ */
|
|
|
+ public List<AddressQueryResVo> queryByEnt(Long id) {
|
|
|
+ LambdaQueryWrapper<KwmAddress> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(KwmAddress::getEntId, id);
|
|
|
+ wrapper.eq(KwmAddress::getDelFlag, Global.NO);
|
|
|
+ List<KwmAddress> kwmAddresses = kwmAddressMapper.selectList(wrapper);
|
|
|
+ if (CollectionUtils.isEmpty(kwmAddresses)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+ return getAddressQueryResVo(kwmAddresses);
|
|
|
+ }
|
|
|
}
|