Commit 243df1f6 by 徐高华

导购

parent 5e0bff6f
...@@ -92,6 +92,8 @@ public interface StaffApiService { ...@@ -92,6 +92,8 @@ public interface StaffApiService {
void wxFristAdd(String userJson, String wxEnterpriseId); void wxFristAdd(String userJson, String wxEnterpriseId);
List<String> listBindStaffId(String storeId); List<String> listBindStaffId(String storeId);
List<String> listBindClerkId(String storeId);
List<StaffClerkRelationDTO> listBindRelationUserId(String storeId); List<StaffClerkRelationDTO> listBindRelationUserId(String storeId);
......
...@@ -631,6 +631,15 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -631,6 +631,15 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override @Override
public List<String> listBindStaffId(String storeId) { public List<String> listBindStaffId(String storeId) {
return this.listBind(storeId, 1) ;
}
@Override
public List<String> listBindClerkId(String storeId) {
return this.listBind(storeId, 2) ;
}
private List<String> listBind(String storeId , int type) {
List<String> userIdList = new ArrayList<String>(); List<String> userIdList = new ArrayList<String>();
List<String> storeIds = new ArrayList<String>(); List<String> storeIds = new ArrayList<String>();
storeIds.add(storeId); storeIds.add(storeId);
...@@ -639,15 +648,21 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -639,15 +648,21 @@ public class StaffApiServiceImpl implements StaffApiService {
if (CollectionUtils.isEmpty(staffRelationList)) { if (CollectionUtils.isEmpty(staffRelationList)) {
return Collections.EMPTY_LIST; return Collections.EMPTY_LIST;
} }
Map<String, StaffClerkRelationDTO> clerkIdMap = staffRelationList.stream().filter(s -> s.getClerkId() != null).collect(Collectors.toMap(StaffClerkRelationDTO::getClerkId, s -> s)); if(type==1) {
Set<String> keySet = clerkIdMap.keySet(); Map<String, StaffClerkRelationDTO> clerkIdMap = staffRelationList.stream().filter(s -> s.getClerkId() != null).collect(Collectors.toMap(StaffClerkRelationDTO::getClerkId, s -> s));
for (String clerkId : clerkList) { Set<String> keySet = clerkIdMap.keySet();
if (keySet.contains(clerkId)) { for (String clerkId : clerkList) {
userIdList.add(clerkIdMap.get(clerkId).getStaffId()); if (keySet.contains(clerkId)) {
userIdList.add(clerkIdMap.get(clerkId).getStaffId());
}
} }
} }
if(type==2) {
userIdList = staffRelationList.stream().filter(s -> s.getClerkId() != null).map(dto->dto.getClerkId()).collect(Collectors.toList());
}
return userIdList; return userIdList;
} }
@Override @Override
public List<StaffClerkRelationDTO> listBindRelationUserId(String storeId) { public List<StaffClerkRelationDTO> listBindRelationUserId(String storeId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment