Commit 1be155f3 by fudahua

绑定的staff信息

parent 7d5aeb4e
...@@ -33,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -33,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -316,15 +317,20 @@ public class StaffController extends WebBaseController{ ...@@ -316,15 +317,20 @@ public class StaffController extends WebBaseController{
List<String> clerkIds = retList.stream().map(ClerkInfoVo::getClerkId).collect(Collectors.toList()); List<String> clerkIds = retList.stream().map(ClerkInfoVo::getClerkId).collect(Collectors.toList());
List<StaffClerkRelationDTO> dtos = staffClerkRelationApiService.listByClerkIds(clerkIds); List<StaffClerkRelationDTO> dtos = staffClerkRelationApiService.listByClerkIds(clerkIds);
if (CollectionUtils.isNotEmpty(dtos)) { if (CollectionUtils.isNotEmpty(dtos)) {
List<String> hasRelationClerkIds = dtos.stream().map(StaffClerkRelationDTO::getClerkId).collect(Collectors.toList()); Map<String, StaffClerkRelationDTO> hasRelationClerkIds = dtos.stream().collect(Collectors.toMap(StaffClerkRelationDTO::getClerkId, mid -> mid));
retList.forEach(clerkInfoVo -> { retList.forEach(clerkInfoVo -> {
if (hasRelationClerkIds.contains(clerkInfoVo.getClerkId())) { if (hasRelationClerkIds.containsKey(clerkInfoVo.getClerkId())) {
clerkInfoVo.setRelationStatus(1); clerkInfoVo.setRelationStatus(1);
StaffDTO staffDTO = staffApiService.selectById(hasRelationClerkIds.get(clerkInfoVo.getClerkId()).getStaffId());
if (staffDTO !=null) {
clerkInfoVo.setStaffName(staffDTO.getStaffName());
}
} }
StoreDTO store = storeService.getStore(clerkInfoVo.getStoreId()); StoreDTO store = storeService.getStore(clerkInfoVo.getStoreId());
if (null != store) { if (null != store) {
clerkInfoVo.setStoreName(store.getStoreName()); clerkInfoVo.setStoreName(store.getStoreName());
} }
}); });
} }
......
...@@ -16,6 +16,26 @@ public class ClerkInfoVo implements Serializable { ...@@ -16,6 +16,26 @@ public class ClerkInfoVo implements Serializable {
private String storeId; private String storeId;
private String storeName; private String storeName;
private Integer relationStatus=0; private Integer relationStatus=0;
private String staffId;
private String staffName;
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public String getStoreId() { public String getStoreId() {
return storeId; return 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