Commit a18b04fc by 墨竹

fix:删除好办登录错误代码

parent 3f86c03d
...@@ -44,16 +44,6 @@ public interface StaffApiService { ...@@ -44,16 +44,6 @@ public interface StaffApiService {
void wxGetAdd(String userId, String wxEnterpriseId); void wxGetAdd(String userId, String wxEnterpriseId);
/**
* 好办登录-如果无该员工新增员工
*
* @param wxOpenUserId wx openuser id
* @param wxEnterpriseId wx企业标识
* @author mozhu
* @date 2022-02-25 14:08:06
*/
void getHaobanWxSave(String wxOpenUserId, String wxEnterpriseId);
void staffEdit(StaffDTO staffDTO, String departmentIds); void staffEdit(StaffDTO staffDTO, String departmentIds);
/** /**
......
...@@ -544,81 +544,9 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -544,81 +544,9 @@ public class StaffApiServiceImpl implements StaffApiService {
logger.info("信息:{}", JSONObject.toJSONString(wxSaveNew)); logger.info("信息:{}", JSONObject.toJSONString(wxSaveNew));
} }
@Override
public void getHaobanWxSave(String wxOpenUserId, String wxEnterpriseId) {
RedisUtil.lock("haoban_add_user" + wxEnterpriseId + wxOpenUserId, 2L);
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
if (null == enterpriseDTO) {
logger.info("企业不存在:{}:{}", wxEnterpriseId, wxOpenUserId);
return;
}
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterpriseId, SecretTypeEnum.HAOBAN_HELP.getVal());
if (null == secretSetting || secretSetting.getCheckFlag() == 0) {
logger.info("没有配置secret:{}", JSONObject.toJSONString(enterpriseDTO));
return;
}
String corpid = enterpriseDTO.getCorpid();
UserDTO user = qywxUserApiService.getWorkWxUser(corpid, config.getWxSuiteid(), wxOpenUserId);
if (null == user) {
logger.info("企业微信用户不存在:{}:{}", wxEnterpriseId, wxOpenUserId);
return;
}
String imageUrl = changeHeaderImageUrl(user.getAvatar());
String mobile = user.getMobile();
String[] arr = getNationCodeAndPhoneNumber(mobile);
String nationCode = arr[0];
String phoneNumber = arr[1];
TabHaobanStaff staff = staffService.selectByPhoneNumberOrUserIdAndEnterpriseId(phoneNumber, wxOpenUserId, wxEnterpriseId);
if (staff != null) {
staffService.delOtherStaffByWxUserId(staff.getWxUserId(), staff.getStaffId(), wxEnterpriseId);
}
staff = (staff == null ? new TabHaobanStaff() : staff);
String userid = qywxUserApiService.getSelfWxUserIdByPhonenumber(corpid, secretSetting.getSecretVal(), phoneNumber);
logger.info("获取到的userid:{}", userid);
staff.setWxUserId(userid);
staff.setWxOpenUseId(wxOpenUserId);
staff.setUpdateTime(new Date());
staff.setStatusFlag(1);
staff.setWxEnterpriseId(wxEnterpriseId);
if (StringUtils.isNotBlank(user.getAvatar())) {
staff.setHeadImg(imageUrl);
}
if (StringUtils.isNotBlank(user.getName())) {
user.setName(EmojiFilterUtil.removeAllEmoji(user.getName()));
staff.setStaffName((user.getName()));
}
if (StringUtils.isNotBlank(user.getAlias())) {
user.setAlias(EmojiFilterUtil.removeAllEmoji(user.getAlias()));
staff.setNickName((user.getAlias()));
}
staff.setPhoneNumber(phoneNumber);
staff.setNationCode(nationCode);
staff.setSex(user.getGender() == null ? 1 : Integer.parseInt(user.getGender()));
staff.setPostion(user.getPosition());
staff.setExtendPostion(user.getExternal_position());
String qr_code = user.getQr_code();
if (StringUtils.isNotBlank(qr_code)) {
staff.setQrCode(qr_code);
}
//成员更改或更新
if (StringUtils.isBlank(staff.getStaffId())) {
logger.info("新增成员");
staff.setActiveFlag(0);
staff.setCreateTime(new Date());
staffService.add(staff);
} else {
staffService.updateByPrimaryKey(staff);
}
logger.info("门店变更保存:{}", JSONObject.toJSONString(user));
staffDepartChange(staff, wxEnterpriseId, user);
}
@Deprecated @Deprecated
public void wxGetAddOld(String userId, String wxEnterpriseId) { public void wxGetAddOld(String userId, String wxEnterpriseId) {
//获取微信用户信息 //获取微信用户信息
TabHaobanStaff staff = staffService.selectByUserIdAndEnterpriseId(userId, wxEnterpriseId); TabHaobanStaff staff = staffService.selectByUserIdAndEnterpriseId(userId, wxEnterpriseId);
if (staff == null) { if (staff == null) {
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
......
...@@ -115,7 +115,7 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -115,7 +115,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
//手机号不存在 //手机号不存在
if (loginStaff == null) { if (loginStaff == null) {
if (enterprise != null) { if (enterprise != null) {
staffApiService.getHaobanWxSave(userId, enterprise.getWxEnterpriseId()); staffApiService.wxGetAdd(userId, enterprise.getWxEnterpriseId());
loginStaff = staffApiService.selectByUserIdAndEnterpriseId(userId, enterprise.getWxEnterpriseId()); loginStaff = staffApiService.selectByUserIdAndEnterpriseId(userId, enterprise.getWxEnterpriseId());
} }
} }
......
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