|
|
@@ -26,6 +26,7 @@ import com.kingdee.eas.common.EASBizException;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.lang.String;
|
|
|
+import java.text.MessageFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
public class BeisenTransferPhaseFacadeControllerBean extends AbstractBeisenTransferPhaseFacadeControllerBean {
|
|
|
@@ -104,16 +105,16 @@ public class BeisenTransferPhaseFacadeControllerBean extends AbstractBeisenTrans
|
|
|
status3B, status3C)) {
|
|
|
throw new BOSException("北森阶段状态为空!");
|
|
|
}
|
|
|
- phaseStatus.put(RECAPPROVAL1, new PhaseStatusInfo(phase1, status1A));
|
|
|
- phaseStatus.put(RECAPPROVAL2, new PhaseStatusInfo(phase1, status1B));
|
|
|
- phaseStatus.put(OFFER1, new PhaseStatusInfo(phase2, status2A));
|
|
|
- phaseStatus.put(OFFER2, new PhaseStatusInfo(phase2, status2B));
|
|
|
- phaseStatus.put(OFFER3, new PhaseStatusInfo(phase2, status2C));
|
|
|
- phaseStatus.put(OFFER4, new PhaseStatusInfo(phase2, status2D));
|
|
|
- phaseStatus.put(OFFER5, new PhaseStatusInfo(phase2, status2E));
|
|
|
- phaseStatus.put(ENROLL1, new PhaseStatusInfo(phase3, status3A));
|
|
|
- phaseStatus.put(ENROLL2, new PhaseStatusInfo(phase3, status3B));
|
|
|
- phaseStatus.put(ENROLL3, new PhaseStatusInfo(phase3, status3C));
|
|
|
+ phaseStatus.put(RECAPPROVAL1, new PhaseStatusInfo(phase1, status1A, "待录用报批"));
|
|
|
+ phaseStatus.put(RECAPPROVAL2, new PhaseStatusInfo(phase1, status1B, "录用终止"));
|
|
|
+ phaseStatus.put(OFFER1, new PhaseStatusInfo(phase2, status2A, "待发Offer"));
|
|
|
+ phaseStatus.put(OFFER2, new PhaseStatusInfo(phase2, status2B, "已发Offer"));
|
|
|
+ phaseStatus.put(OFFER3, new PhaseStatusInfo(phase2, status2C, "拒绝Offer"));
|
|
|
+ phaseStatus.put(OFFER4, new PhaseStatusInfo(phase2, status2D, "接受Offer"));
|
|
|
+ phaseStatus.put(OFFER5, new PhaseStatusInfo(phase2, status2E, "等待入职"));
|
|
|
+ phaseStatus.put(ENROLL1, new PhaseStatusInfo(phase3, status3A, "已入职"));
|
|
|
+ phaseStatus.put(ENROLL2, new PhaseStatusInfo(phase3, status3B, "取消入职"));
|
|
|
+ phaseStatus.put(ENROLL3, new PhaseStatusInfo(phase3, status3C, "已离职"));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -375,16 +376,17 @@ public class BeisenTransferPhaseFacadeControllerBean extends AbstractBeisenTrans
|
|
|
) throws BOSException, IOException, EASBizException {
|
|
|
BeisenApiClient beisenApiClient = BeisenApiClient.getInstance();
|
|
|
IOffer iOffer = OfferFactory.getLocalInstance(ctx);
|
|
|
- for (String statusName : recApprovalMap.keySet()) {
|
|
|
+ for (String status : recApprovalMap.keySet()) {
|
|
|
try {
|
|
|
//申请id
|
|
|
- JSONArray applyIds = recApprovalMap.get(statusName);
|
|
|
- PhaseStatusInfo phaseStatusInfo = phaseStatus.get(statusName);
|
|
|
+ JSONArray applyIds = recApprovalMap.get(status);
|
|
|
+ PhaseStatusInfo phaseStatusInfo = phaseStatus.get(status);
|
|
|
+ String statusName = phaseStatusInfo.getStatusName();
|
|
|
JSONObject params = new JSONObject();
|
|
|
params.put("applyIds", applyIds);
|
|
|
params.put("phaseId", phaseStatusInfo.getPhaseId());
|
|
|
params.put("statusId", phaseStatusInfo.getStatusId());
|
|
|
- logger.error("同步北森状态statusName: " + statusName);
|
|
|
+ logger.error("同步北森状态statusName: " + status);
|
|
|
logger.error("同步北森状态url: " + BeisenParam.POST_TRANSFERPHASE_URL);
|
|
|
logger.error("同步北森状态参数: " + params.toJSONString());
|
|
|
JSONObject response = beisenApiClient.callApi(BeisenParam.POST_TRANSFERPHASE_URL, params);
|
|
|
@@ -406,7 +408,7 @@ public class BeisenTransferPhaseFacadeControllerBean extends AbstractBeisenTrans
|
|
|
//移除失败的申请id
|
|
|
applyIds.remove(applyid);
|
|
|
});
|
|
|
- updateTable(ctx, tableName, errorMsg, "2", fids);
|
|
|
+ updateTable(ctx, tableName, MessageFormat.format("[{0}]状态同步失败: {1}", statusName, errorMsg), "2", fids);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -417,7 +419,7 @@ public class BeisenTransferPhaseFacadeControllerBean extends AbstractBeisenTrans
|
|
|
String applyId = applyIds.get(i).toString();
|
|
|
fids.add(applyIdStatusMap.get(applyId));
|
|
|
}
|
|
|
- updateTable(ctx, tableName, "成功", "1", fids);
|
|
|
+ updateTable(ctx, tableName, MessageFormat.format("[{0}]状态同步成功", statusName), "1", fids);
|
|
|
}
|
|
|
} else {
|
|
|
Set fids = new HashSet<>();
|
|
|
@@ -425,9 +427,10 @@ public class BeisenTransferPhaseFacadeControllerBean extends AbstractBeisenTrans
|
|
|
fids.add(id);
|
|
|
});
|
|
|
updateTable(ctx, tableName, message, "2", fids);
|
|
|
+ updateTable(ctx, tableName, MessageFormat.format("[{0}]状态同步失败: {1}", statusName, message), "2", fids);
|
|
|
}
|
|
|
//已入职
|
|
|
- if (ENROLL1.equals(statusName) && !applyIds.isEmpty()) {
|
|
|
+ if (ENROLL1.equals(status) && !applyIds.isEmpty()) {
|
|
|
//入职成功需要调用北森招聘到岗接口同步
|
|
|
JSONObject entryhandleParams = new JSONObject();
|
|
|
for (int i = 0; i < applyIds.size(); i++) {
|
|
|
@@ -446,10 +449,11 @@ public class BeisenTransferPhaseFacadeControllerBean extends AbstractBeisenTrans
|
|
|
JSONObject result = beisenApiClient.callApi(BeisenParam.POST_ENTRYHANDLE_URL, entryhandleParams);
|
|
|
logger.error("北森招聘到岗响应" + result.toJSONString());
|
|
|
if (result.getInteger("code") != 200) {
|
|
|
- logger.error("北森招聘到岗响应报错: " + result.getString("message"));
|
|
|
- updateTable(ctx, tableName, result.getString("message"), "2", AtsUtil.toSet(offerId));
|
|
|
+ String errorMessage = result.getString("message");
|
|
|
+ logger.error("北森招聘到岗响应报错: " + errorMessage);
|
|
|
+ updateTable(ctx, tableName, MessageFormat.format("[{0}]状态同步失败: {1}", statusName, errorMessage), "2", AtsUtil.toSet(offerId));
|
|
|
} else {
|
|
|
- updateTable(ctx, tableName, "成功", "1", AtsUtil.toSet(offerId));
|
|
|
+ updateTable(ctx, tableName, MessageFormat.format("[{0}]状态同步成功", statusName), "1", AtsUtil.toSet(offerId));
|
|
|
}
|
|
|
}
|
|
|
}
|