|
@@ -2,6 +2,7 @@ package com.yiqi.app.service.impl;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -16,6 +17,8 @@ import com.yiqi.common.exception.GlobalException;
|
|
|
import com.yiqi.common.utils.DateUtils;
|
|
|
import com.yiqi.common.utils.SecurityUtils;
|
|
|
import com.yiqi.common.utils.bean.BeanUtils;
|
|
|
+import com.yiqi.system.domain.SysStore;
|
|
|
+import com.yiqi.system.service.ISysStoreService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.yiqi.app.mapper.AppDeliveryManMapper;
|
|
@@ -33,7 +36,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
public class AppDeliveryManServiceImpl extends ServiceImpl<AppDeliveryManMapper, AppDeliveryMan> implements IAppDeliveryManService {
|
|
|
@Autowired
|
|
|
private IAppDeliveryRelationService appDeliveryRelationService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private ISysStoreService sysStoreService;
|
|
|
/**
|
|
|
* 查询配送员
|
|
|
*
|
|
@@ -173,5 +177,16 @@ public class AppDeliveryManServiceImpl extends ServiceImpl<AppDeliveryManMapper,
|
|
|
return baseMapper.getDeliveryManListByOrg(SecurityUtils.getLoginUser().getOrgId(), SecurityUtils.getLoginUser().getSourceType());
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ @Override
|
|
|
+ public List<SysStore> getStoreList(Long deliveryId) {
|
|
|
+ //查询配送员绑定的门店列表
|
|
|
+ List<AppDeliveryRelation> list = appDeliveryRelationService.list(new QueryWrapper<AppDeliveryRelation>().lambda()
|
|
|
+ .eq(AppDeliveryRelation::getAppUserId, deliveryId));
|
|
|
+ if (CollUtil.isNotEmpty(list)) {
|
|
|
+ List<Long> storeIds = list.stream().map(AppDeliveryRelation::getOrgId).collect(Collectors.toList());
|
|
|
+ return sysStoreService.list(new QueryWrapper<SysStore>().lambda()
|
|
|
+ .in(SysStore::getId, storeIds));
|
|
|
+ }
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
}
|