|
|
@@ -7,9 +7,11 @@ import com.kingdee.bos.BOSException;
|
|
|
import com.kingdee.bos.Context;
|
|
|
import com.kingdee.bos.bsf.service.app.IHRMsfService;
|
|
|
import com.kingdee.bos.dao.IObjectPK;
|
|
|
+import com.kingdee.bos.metadata.entity.SelectorItemCollection;
|
|
|
import com.kingdee.bos.util.BOSUuid;
|
|
|
import com.kingdee.eas.basedata.org.HROrgUnitInfo;
|
|
|
import com.kingdee.eas.common.EASBizException;
|
|
|
+import com.kingdee.eas.custom.recuritment.ApplicantBeisenCollection;
|
|
|
import com.kingdee.eas.custom.recuritment.ApplicantBeisenFactory;
|
|
|
import com.kingdee.eas.custom.recuritment.ApplicantBeisenInfo;
|
|
|
import com.kingdee.eas.custom.recuritment.IApplicantBeisen;
|
|
|
@@ -18,7 +20,6 @@ import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
|
|
|
import com.kingdee.util.StringUtils;
|
|
|
import org.apache.log4j.Logger;
|
|
|
|
|
|
-import java.text.MessageFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
@@ -68,25 +69,45 @@ public class SaveBeisenApplyIdService implements IHRMsfService {
|
|
|
applyId = data.getString("applyId");
|
|
|
//应聘id
|
|
|
String candidateId = data.getString("candidateId");
|
|
|
+ //需求名称
|
|
|
+ String recuritmentName = data.getString("recuritmentName");
|
|
|
+ //应聘者名称
|
|
|
+ String candidateName = data.getString("candidateName");
|
|
|
if (StringUtils.isEmpty(applyId)) {
|
|
|
throw new ShrWebBizException("申请id不能为空!");
|
|
|
}
|
|
|
IApplicantBeisen iApplicantBeisen = ApplicantBeisenFactory.getLocalInstance(ctx);
|
|
|
- boolean isExists = iApplicantBeisen.exists("where applyId='" + applyId + "' ");
|
|
|
- if (isExists) {
|
|
|
- String errorMsg = MessageFormat.format(ERRORMSGTEMPLATE, applyId, candidateId);
|
|
|
- throw new ShrWebBizException(errorMsg);
|
|
|
+ ApplicantBeisenCollection applicantBeisenCollection = iApplicantBeisen.getApplicantBeisenCollection("where applyId='" + applyId + "' ");
|
|
|
+ if (!applicantBeisenCollection.isEmpty()) {
|
|
|
+ ApplicantBeisenInfo applicantBeisenInfo = applicantBeisenCollection.get(0);
|
|
|
+ ExecuteResultEnum syncStatus = applicantBeisenInfo.getSyncStatus();
|
|
|
+ //同步状态为执行失败,则更新成未执行
|
|
|
+ if (ExecuteResultEnum.ERROR.equals(syncStatus)) {
|
|
|
+ SelectorItemCollection updateSic = new SelectorItemCollection();
|
|
|
+ updateSic.add("syncStatus");
|
|
|
+ updateSic.add("syncResult");
|
|
|
+ applicantBeisenInfo.setSyncStatus(ExecuteResultEnum.UNEXECUTE);
|
|
|
+ applicantBeisenInfo.setSyncResult("");
|
|
|
+ iApplicantBeisen.updatePartial(applicantBeisenInfo, updateSic);
|
|
|
+ }
|
|
|
+ listMsg.add(packageResult(applyId, 200, applicantBeisenInfo.getId().toString(), "成功"));
|
|
|
+ successSize++;
|
|
|
+ //String errorMsg = MessageFormat.format(ERRORMSGTEMPLATE, applyId, candidateId);
|
|
|
+ //throw new ShrWebBizException(errorMsg);
|
|
|
+ } else {
|
|
|
+ ApplicantBeisenInfo applicantBeisenInfo = new ApplicantBeisenInfo();
|
|
|
+ HROrgUnitInfo hrOrgUnitInfo = new HROrgUnitInfo();
|
|
|
+ hrOrgUnitInfo.setId(BOSUuid.read("00000000-0000-0000-0000-000000000000CCE7AED4"));
|
|
|
+ applicantBeisenInfo.setHrOrgUnit(hrOrgUnitInfo);
|
|
|
+ applicantBeisenInfo.setApplyId(applyId);
|
|
|
+ applicantBeisenInfo.setRecuritmentName(recuritmentName);
|
|
|
+ applicantBeisenInfo.setCandidateId(candidateId);
|
|
|
+ applicantBeisenInfo.setCandidateName(candidateName);
|
|
|
+ applicantBeisenInfo.setSyncStatus(ExecuteResultEnum.UNEXECUTE);
|
|
|
+ IObjectPK addnew = iApplicantBeisen.addnew(applicantBeisenInfo);
|
|
|
+ listMsg.add(packageResult(applyId, 200, addnew.toString(), "成功"));
|
|
|
+ successSize++;
|
|
|
}
|
|
|
- ApplicantBeisenInfo applicantBeisenInfo = new ApplicantBeisenInfo();
|
|
|
- HROrgUnitInfo hrOrgUnitInfo = new HROrgUnitInfo();
|
|
|
- hrOrgUnitInfo.setId(BOSUuid.read("00000000-0000-0000-0000-000000000000CCE7AED4"));
|
|
|
- applicantBeisenInfo.setHrOrgUnit(hrOrgUnitInfo);
|
|
|
- applicantBeisenInfo.setApplyId(applyId);
|
|
|
- applicantBeisenInfo.setCandidateId(candidateId);
|
|
|
- applicantBeisenInfo.setSyncStatus(ExecuteResultEnum.UNEXECUTE);
|
|
|
- IObjectPK addnew = iApplicantBeisen.addnew(applicantBeisenInfo);
|
|
|
- listMsg.add(packageResult(applyId, 200, addnew.toString(), "成功"));
|
|
|
- successSize++;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -99,7 +120,6 @@ public class SaveBeisenApplyIdService implements IHRMsfService {
|
|
|
mapMsg.put("successSize", successSize);
|
|
|
mapMsg.put("message", "请求成功!");
|
|
|
return mapMsg;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|