Commit 0188aa4a by fudahua

Merge branch 'developer' into 'master'

Developer

See merge request !24
parents 2d1dc2ca 3614db44
......@@ -668,9 +668,9 @@ public class StaffApiServiceImpl implements StaffApiService {
}
String departmentId = department.getDepartmentId();
String wxEnterpriseId = department.getWxEnterpriseId();
StaffDTO staff = this.selectByNationcodeAndPhoneNumber(wxEnterpriseId, nationcode, phoneNumber);
if(staff == null){
// StaffDTO staff = this.selectByNationcodeAndPhoneNumber(wxEnterpriseId, nationcode, phoneNumber);
StaffDTO staff = geCcheckAndInitUser(wxEnterpriseId, nationcode, phoneNumber);
if(staff == null){
if(status != 1){
return;
}else{
......@@ -766,6 +766,27 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
private StaffDTO geCcheckAndInitUser(String wxEnterpriseId, String nationcode, String phoneNumber) {
logger.info("校验获取信息:{}", phoneNumber);
StaffDTO staff = this.selectByNationcodeAndPhoneNumber(wxEnterpriseId, nationcode, phoneNumber);
if (null != staff) {
return staff;
}
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 1);
if (null == enterpriseDTO || application == null) {
return null;
}
String userId = qywxUserApiService.getWxUserIdByPhonenumber(enterpriseDTO.getCorpid(), application.getSiteId(), phoneNumber);
logger.info("获取userId:{},{}", phoneNumber, userId);
if (userId == null) {
return null;
}
wxGetAdd(userId, wxEnterpriseId);
return this.selectByUserIdAndEnterpriseId(userId, wxEnterpriseId);
}
@Override
public StaffDepartmentRelatedDTO getDepartmentIdAndCode(String departmentId, String code) {
return EntityUtil.changeEntityByJSON(StaffDepartmentRelatedDTO.class, staffDepartmentRelatedMapper.getDepartmentIdAndCode(departmentId,code));
......
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