Commit 72c0e7d7 by 谢海旭

招聘管理:离职后重新添加试岗并审批通过,账号处理

1 parent 654b85f5
...@@ -8,6 +8,11 @@ import cn.com.glsx.dj.smartcarlife.model.ServiceMerchant; ...@@ -8,6 +8,11 @@ import cn.com.glsx.dj.smartcarlife.model.ServiceMerchant;
import cn.com.glsx.dj.smartcarlife.remote.SceneMerchantRefRemote; import cn.com.glsx.dj.smartcarlife.remote.SceneMerchantRefRemote;
import cn.com.glsx.dj.smartcarlife.remote.SceneRemote; import cn.com.glsx.dj.smartcarlife.remote.SceneRemote;
import cn.com.glsx.dj.smartcarlife.remote.StaffBaseInfoRemote; import cn.com.glsx.dj.smartcarlife.remote.StaffBaseInfoRemote;
import cn.com.glsx.dj.smartcarlife.enums.StaffStatusEnum;
import cn.com.glsx.merchants.model.request.StaffBatchRequest;
import cn.com.glsx.merchants.remote.MerchantStaffRemote;
import cn.hutool.core.thread.ThreadUtil;
import java.util.concurrent.TimeUnit;
import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentDemandDetailDTO; import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentDemandDetailDTO;
import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentProcessResultDTO; import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentProcessResultDTO;
import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentTrialOnboardingDTO; import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentTrialOnboardingDTO;
...@@ -50,6 +55,9 @@ public class RecruitmentTrialOnboardingService { ...@@ -50,6 +55,9 @@ public class RecruitmentTrialOnboardingService {
@Autowired @Autowired
private StaffBaseInfoRemote staffBaseInfoRemote; private StaffBaseInfoRemote staffBaseInfoRemote;
@Autowired
private MerchantStaffRemote merchantStaffRemote;
/** /**
* 处理试岗人员List * 处理试岗人员List
* *
...@@ -370,13 +378,43 @@ public class RecruitmentTrialOnboardingService { ...@@ -370,13 +378,43 @@ public class RecruitmentTrialOnboardingService {
} }
dto.setShopItemList(shopItemList); dto.setShopItemList(shopItemList);
// 9. 调用RPC开通驻店账号(幂等逻辑在内) // 9. 请求账户中心,将关联园区店账号状态恢复为正常
String phone = trial.getPhoneNumber();
for (Integer yqMerchantId : yqGroupMap.keySet()) {
try {
StaffBatchRequest staffBatchRequest = new StaffBatchRequest();
staffBatchRequest.setStaffPhone(phone);
staffBatchRequest.setMerchantId(String.valueOf(yqMerchantId));
staffBatchRequest.setStatus(StaffStatusEnum.NOT_DELETED.getValue());
log.info("试岗审批通过恢复账号状态,phone:{},yqMerchantId:{},trialId:{}", phone, yqMerchantId, trialId);
RpcResponse<Boolean> response = merchantStaffRemote.updateStaffStatusByPhone(staffBatchRequest);
if (response.hasResult()) {
log.info("账户中心恢复账号状态成功,phone:{},yqMerchantId:{}", phone, yqMerchantId);
} else {
log.error("账户中心恢复账号状态失败,phone:{},yqMerchantId:{},msg:{}", phone, yqMerchantId, response.getMessage());
}
} catch (Exception e) {
log.error("账户中心恢复账号状态异常,phone:{},yqMerchantId:{}", phone, yqMerchantId, e);
}
}
// 10. 延迟1秒后异步开通驻店账号
ThreadUtil.execute(() -> {
try {
TimeUnit.SECONDS.sleep(1);
RpcResponse<String> response = staffBaseInfoRemote.initTrialStaff(dto); RpcResponse<String> response = staffBaseInfoRemote.initTrialStaff(dto);
if (response.isSuccess()) { if (response.isSuccess()) {
log.info("试岗审批通过开通驻店账号成功,trialId:{},phone:{}", trialId, trial.getPhoneNumber()); log.info("试岗审批通过开通驻店账号成功,trialId:{},phone:{}", trialId, phone);
} else { } else {
log.error("试岗审批通过开通驻店账号失败,trialId:{},phone:{},msg:{}", trialId, trial.getPhoneNumber(), response.getMessage()); log.error("试岗审批通过开通驻店账号失败,trialId:{},phone:{},msg:{}", trialId, phone, response.getMessage());
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.error("延迟开通驻店账号线程中断,trialId:{}", trialId, e);
} catch (Exception e) {
log.error("延迟开通驻店账号异常,trialId:{},phone:{}", trialId, phone, e);
} }
});
} }
/** /**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!