Commit a22639d5 by fudahua

搜索成员账号

parent e19520c8
package com.gic.haoban.manage.web.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.Cookie;
import com.alibaba.fastjson.JSONObject;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.service.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkNewService;
import com.gic.clerk.api.service.ClerkService;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.DepartmentService;
import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.PageResult;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.web.auth.AuthRequestUtil;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.StaffEditJsonQO;
import com.gic.haoban.manage.web.vo.ClerkInfoVo;
import com.gic.haoban.manage.web.vo.LoginVO;
import com.gic.haoban.manage.web.vo.StaffVO;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@RestController
......@@ -55,6 +54,9 @@ public class StaffController extends WebBaseController{
private WxApplicationApiService wxApplicationApiService;
@Autowired
private ClerkService clerkService;
@Autowired
private ClerkNewService clerkNewService;
@Autowired
private StoreService storeService;
......@@ -298,12 +300,24 @@ public class StaffController extends WebBaseController{
if (CollectionUtil.isEmpty(list)) {
return resultResponse(HaoBanErrCode.ERR_10010);
}
List<String> enterpriseIds = list.stream().map(EnterpriseDetailDTO::getEnterpriseId).collect(Collectors.toList());
List<ClerkDTO> clerkDTOList = clerkNewService.listClerkByEnterpriseIdAndSearch(enterpriseIds, search);
List<ClerkInfoVo> retList = EntityUtil.changeEntityListByJSON(ClerkInfoVo.class, clerkDTOList);
if (CollectionUtils.isNotEmpty(retList)) {
List<String> clerkIds = retList.stream().map(ClerkInfoVo::getClerkId).collect(Collectors.toList());
List<StaffClerkRelationDTO> dtos = staffClerkRelationApiService.listByClerkIds(clerkIds);
if (CollectionUtils.isNotEmpty(dtos)) {
List<String> hasRelationClerkIds = dtos.stream().map(StaffClerkRelationDTO::getClerkId).collect(Collectors.toList());
retList.forEach(clerkInfoVo -> {
if (hasRelationClerkIds.contains(clerkInfoVo.getClerkId())) {
clerkInfoVo.setRelationStatus(1);
}
});
}
List<String> phoneList = clerkService.queryClerkEnterpriseByPhoneNumber(search);
if (CollectionUtils.isNotEmpty(phoneList)) {
// clerkService.
}
return resultResponse(HaoBanErrCode.ERR_1);
return resultResponse(HaoBanErrCode.ERR_1,retList);
//todo 还没好
}
......
package com.gic.haoban.manage.web.vo;
import java.io.Serializable;
/**
* Created 2020/6/1.
*
* @author hua
*/
public class ClerkInfoVo implements Serializable {
private String clerkName;
private String clerkCode;
private String clerkId;
private Integer relationStatus=0;
public String getClerkName() {
return clerkName;
}
public void setClerkName(String clerkName) {
this.clerkName = clerkName;
}
public String getClerkCode() {
return clerkCode;
}
public void setClerkCode(String clerkCode) {
this.clerkCode = clerkCode;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public Integer getRelationStatus() {
return relationStatus;
}
public void setRelationStatus(Integer relationStatus) {
this.relationStatus = relationStatus;
}
}
......@@ -37,6 +37,7 @@
timeout="20000"/>
<dubbo:reference interface="com.gic.clerk.api.service.ClerkService" id="clerkService"/>
<dubbo:reference interface="com.gic.clerk.api.service.ClerkNewService" id="clerkNewService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService" id="staffDepartmentRelatedApiService"/>
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxCorpApiService" id="qywxCorpApiService"/>
......
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