Commit 27355ddf by 杨卫

fix:1026233:运营人员只查询正常员工

1 parent d324fe05
......@@ -19,9 +19,12 @@ import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.merchants.model.request.MerchantStaffRequest;
import cn.com.glsx.merchants.model.request.serviceCenter.SearchMerchantRpcRequest;
import cn.com.glsx.merchants.model.response.MerchantStaffResponse;
import cn.com.glsx.merchants.model.response.merchant.MerchantNameResponse;
import cn.com.glsx.merchants.remote.MerchantRemote;
import cn.com.glsx.merchants.remote.MerchantStaffRemote;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollUtil;
......@@ -65,6 +68,7 @@ public class BiAnalyseBackgroundService {
private final MerchantRemote merchantRemote;
private final BiAnalysisRemote biAnalysisRemote;
private final GoodsOrderMapper goodsOrderMapper;
private final MerchantStaffRemote merchantStaffRemote;
private final MerchantBiMatterMapper merchantBiMatterMapper;
private final ProvinceRganizationMapper provinceRganizationMapper;
private final MerchantProfitRecordMapper merchantProfitRecordMapper;
......@@ -870,6 +874,22 @@ public class BiAnalyseBackgroundService {
if (CollUtil.isEmpty(directorConfigs)) {
return result;
}
List<String> uuids = directorConfigs.stream()
.map(ShopMerchantDirectorConfig::getDirectorUserId)
.filter(StrUtil::isNotEmpty).distinct().collect(Collectors.toList());
if (CollUtil.isNotEmpty(uuids)) {
// 过滤禁用员工
MerchantStaffRequest staffRequest = new MerchantStaffRequest();
staffRequest.setStaffUuidList(uuids);
staffRequest.setDelFlag((byte) 0);
RpcResponse<List<MerchantStaffResponse>> merchantStaffListRemote = merchantStaffRemote.findMerchantStaffListRemote(staffRequest);
if (merchantStaffListRemote.isSuccess() && merchantStaffListRemote.hasResult()) {
Set<String> staffUuids = merchantStaffListRemote.getResult().stream().map(MerchantStaffResponse::getUuid).collect(Collectors.toSet());
directorConfigs.removeIf(ele -> !staffUuids.contains(ele.getDirectorUserId()));
}
}
// 先按照merchantId分组,再按照directType分组
Map<Integer, Map<Byte, Set<MerchantBiMatterDTO.OperatorDTO>>> merchantIdMapDirectorTypeMapOperator = directorConfigs.stream()
.collect(Collectors.groupingBy(ShopMerchantDirectorConfig::getMerchantId,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!