Commit 9d215b68 by 徐高华

成员列表导购查询

parent 2e013cfa
...@@ -69,6 +69,26 @@ public class StaffListDTO implements Serializable { ...@@ -69,6 +69,26 @@ public class StaffListDTO implements Serializable {
*/ */
private String endTime; private String endTime;
private String staffId ;
private String loginEnterpriseId ;
public String getLoginEnterpriseId() {
return loginEnterpriseId;
}
public void setLoginEnterpriseId(String loginEnterpriseId) {
this.loginEnterpriseId = loginEnterpriseId;
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getStartTime() { public String getStartTime() {
return startTime; return startTime;
} }
......
...@@ -73,6 +73,16 @@ public class StaffListBO implements Serializable { ...@@ -73,6 +73,16 @@ public class StaffListBO implements Serializable {
*/ */
private String endTime; private String endTime;
private String staffId ;
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getStartTime() { public String getStartTime() {
return startTime; return startTime;
} }
......
...@@ -212,6 +212,13 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -212,6 +212,13 @@ public class StaffApiServiceImpl implements StaffApiService {
//解决空指针异常问题 //解决空指针异常问题
Map<String, String> map = list.stream().collect(HashMap::new,(k, v) -> k.put(v.getEnterpriseId(), v.getEnterpriseName()), HashMap::putAll); Map<String, String> map = list.stream().collect(HashMap::new,(k, v) -> k.put(v.getEnterpriseId(), v.getEnterpriseName()), HashMap::putAll);
List<StaffClerkRelationDTO> relationDTOList = staffClerkRelationService.listByWxEnterpriseIdAndStaffId(wxEnterpriseId, staffIdList); List<StaffClerkRelationDTO> relationDTOList = staffClerkRelationService.listByWxEnterpriseIdAndStaffId(wxEnterpriseId, staffIdList);
String loginEnterpriseId = staffListDTO.getLoginEnterpriseId() ;
Map<String,ClerkDTO> clerkMap = new HashMap<>() ;
if(CollectionUtils.isNotEmpty(relationDTOList)) {
Set<String> clerkIdSet = relationDTOList.stream().filter(o->o.getEnterpriseId().equals(loginEnterpriseId)).map(o->o.getClerkId()).collect(Collectors.toSet()) ;
List<ClerkDTO> clerkDTOS = this.clerkService.getClerkByIds(clerkIdSet) ;
clerkMap.putAll(clerkDTOS.stream().collect(Collectors.toMap(o->o.getClerkId(),o->o,(k1,k2)->k1)));
}
staffDTOList.forEach(one -> { staffDTOList.forEach(one -> {
if(relationIdList.contains(one.getStaffId())){ if(relationIdList.contains(one.getStaffId())){
one.setRelationFlag(1); one.setRelationFlag(1);
...@@ -220,6 +227,14 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -220,6 +227,14 @@ public class StaffApiServiceImpl implements StaffApiService {
for (StaffClerkRelationDTO dto : relationDTOList){ for (StaffClerkRelationDTO dto : relationDTOList){
if (dto.getStaffId().equals(one.getStaffId())){ if (dto.getStaffId().equals(one.getStaffId())){
enterpriseNameList.add(map.get(dto.getEnterpriseId())); enterpriseNameList.add(map.get(dto.getEnterpriseId()));
if(null != clerkMap.get(dto.getClerkId())) {
String c = one.getClerkCode() ;
if(StringUtils.isBlank(c)) {
one.setClerkCode(clerkMap.get(dto.getClerkId()).getClerkCode());
}else {
one.setClerkCode(c+"、"+clerkMap.get(dto.getClerkId()).getClerkCode());
}
}
} }
} }
if (CollUtil.isNotEmpty(enterpriseNameList)){ if (CollUtil.isNotEmpty(enterpriseNameList)){
......
...@@ -307,7 +307,10 @@ ...@@ -307,7 +307,10 @@
<if test="departmentIds != null and departmentIds.size() > 0"> <if test="departmentIds != null and departmentIds.size() > 0">
left join tab_haoban_staff_department_related b on a.staff_id = b.staff_id and b.status_flag = 1 left join tab_haoban_staff_department_related b on a.staff_id = b.staff_id and b.status_flag = 1
</if> </if>
where a.wx_enterprise_id = #{wxEnterpriseId} where a.wx_enterprise_id = #{wxEnterpriseId}
<if test="null != staffId">
and a.staff_id = #{staffId}
</if>
<if test="occupy == null or 1!=occupy"> <if test="occupy == null or 1!=occupy">
and a.status_flag = 1 and a.status_flag = 1
</if> </if>
......
...@@ -135,6 +135,13 @@ public class StaffController extends WebBaseController { ...@@ -135,6 +135,13 @@ public class StaffController extends WebBaseController {
} }
//员工 //员工
StaffListDTO dto = EntityUtil.changeEntityByJSON(StaffListDTO.class, qo); StaffListDTO dto = EntityUtil.changeEntityByJSON(StaffListDTO.class, qo);
if(StringUtils.isNotBlank(qo.getClerkId())) {
StaffClerkRelationDTO clerkRelationDTO = this.staffClerkRelationApiService.getByClerkId(qo.getClerkId()) ;
if(null == clerkRelationDTO) {
return resultResponse(HaoBanErrCode.ERR_1, PageUtil.getPageInfo(new Page<>()));
}
dto.setStaffId(clerkRelationDTO.getStaffId());
}
dto.setWxEnterpriseId(wxEnterpriseId); dto.setWxEnterpriseId(wxEnterpriseId);
dto.setDepartmentIds(departmentIds); dto.setDepartmentIds(departmentIds);
if (qo.getGetAllFlag() == 1){ if (qo.getGetAllFlag() == 1){
...@@ -144,6 +151,7 @@ public class StaffController extends WebBaseController { ...@@ -144,6 +151,7 @@ public class StaffController extends WebBaseController {
basePageInfo.setPageSize(Integer.MAX_VALUE); basePageInfo.setPageSize(Integer.MAX_VALUE);
dto.setPageInfo(basePageInfo); dto.setPageInfo(basePageInfo);
} }
dto.setLoginEnterpriseId(login.getEnterpriseId());
Page<StaffDTO> page = staffApiService.pageStaff(dto); Page<StaffDTO> page = staffApiService.pageStaff(dto);
logger.info("pages={},totalPage={}", page.getCurrentPage(), page.getTotalPage()); logger.info("pages={},totalPage={}", page.getCurrentPage(), page.getTotalPage());
......
...@@ -63,6 +63,16 @@ public class StaffListQO implements Serializable { ...@@ -63,6 +63,16 @@ public class StaffListQO implements Serializable {
*/ */
private Integer getAllFlag = 0; private Integer getAllFlag = 0;
private String clerkId ;
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public Integer getGetAllFlag() { public Integer getGetAllFlag() {
return getAllFlag; return getAllFlag;
} }
......
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