Commit 941436ef by 墨竹

feat:新增是否能查询客户详情接口

parent 48f6e5a1
...@@ -11,7 +11,8 @@ import com.gic.dict.api.service.ManagerDictService; ...@@ -11,7 +11,8 @@ import com.gic.dict.api.service.ManagerDictService;
import com.gic.enterprise.api.dto.EnterpriseDTO; import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.dto.StoreDTO; import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.EnterpriseService; import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.app.customer.dto.StaffOpenRelatedDTO; import com.gic.haoban.app.customer.dto.*;
import com.gic.haoban.app.customer.service.api.service.CustomerApiService;
import com.gic.haoban.app.customer.service.api.service.StaffMemberRelationApiService; import com.gic.haoban.app.customer.service.api.service.StaffMemberRelationApiService;
import com.gic.haoban.common.anno.HttpLimit; import com.gic.haoban.common.anno.HttpLimit;
import com.gic.haoban.common.anno.IgnoreLogin; import com.gic.haoban.common.anno.IgnoreLogin;
...@@ -91,6 +92,8 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -91,6 +92,8 @@ public class WxEnterpriseInfoController extends WebBaseController {
private WxApplicationApiService wxApplicationApiService; private WxApplicationApiService wxApplicationApiService;
@Autowired @Autowired
private ClerkMainStoreRelatedApiService clerkMainStoreRelatedApiService; private ClerkMainStoreRelatedApiService clerkMainStoreRelatedApiService;
@Autowired
private CustomerApiService customerApiService;
/** /**
...@@ -382,6 +385,62 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -382,6 +385,62 @@ public class WxEnterpriseInfoController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_1, result); return resultResponse(HaoBanErrCode.ERR_1, result);
} }
/**
* 是否能打开客户详情权限
* @param clerkId
* @param memberId
* @param storeId
* @param enterpriseId
* @return
*/
@RequestMapping("get-member-clerk-flag")
public HaobanResponse getMemberFlag(String clerkId, String memberId, String storeId, String enterpriseId) {
if (StringUtils.isAnyBlank(clerkId, memberId, storeId)) {
return resultResponse(HaoBanErrCode.ERR_2);
}
CustomerDTO params = new CustomerDTO();
params.setClerkType("0");
params.setStoreId(storeId);
params.setClerkId(clerkId);
params.setEnterpriseId(enterpriseId);
params.setStoreManagerFlag(isManager(clerkId));
MemberInfoListParamsDTO memberInfoListParamsDTO = new MemberInfoListParamsDTO();
memberInfoListParamsDTO.setMemberId(memberId);
FilterListDTO filterListDTO = new FilterListDTO();
filterListDTO.setFilterType("4");
ChildDTO childDTO = new ChildDTO();
childDTO.setId("");
filterListDTO.setChild(childDTO);
List<FilterListDTO> filterList = new ArrayList<>();
filterList.add(filterListDTO);
memberInfoListParamsDTO.setFilterList(filterList);
boolean flag = customerApiService.checkMemberRangeByMemberId(params, memberInfoListParamsDTO);
if (flag) {
return resultResponse(HaoBanErrCode.ERR_1, true);
} else {
return resultResponse(HaoBanErrCode.ERR_1, false);
}
}
/**
* 是否店长
*
* @param clerkId
* @return
*/
private boolean isManager(String clerkId) {
ClerkDTO clerkDTO = clerkService.getclerkById(clerkId);
if (clerkDTO != null) {
Integer isManager = clerkDTO.getClerkType();
return isManager != null && isManager == 1 && clerkDTO.getStatus() == 1;
}
return false;
}
@RequestMapping("get-staff-info") @RequestMapping("get-staff-info")
public HaobanResponse getStaffInfo(String phoneNumber) { public HaobanResponse getStaffInfo(String phoneNumber) {
if (StringUtils.isBlank(phoneNumber)) { if (StringUtils.isBlank(phoneNumber)) {
...@@ -424,7 +483,7 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -424,7 +483,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
logger.info("企业不存在没有绑定,wxEnterpriseId:{}", wxEnterpriseId); logger.info("企业不存在没有绑定,wxEnterpriseId:{}", wxEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_400002); return resultResponse(HaoBanErrCode.ERR_400002);
} }
StaffDTO staffDTO = staffApiService.selectByUserIdAndEnterpriseId(wxUserId,wxEnterpriseId); StaffDTO staffDTO = staffApiService.selectByUserIdAndEnterpriseId(wxUserId, wxEnterpriseId);
if (staffDTO == null) { if (staffDTO == null) {
logger.info("查询到该员工,wxUserId:{}", wxUserId); logger.info("查询到该员工,wxUserId:{}", wxUserId);
return resultResponse(HaoBanErrCode.ERR_400017); return resultResponse(HaoBanErrCode.ERR_400017);
......
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