Bladeren bron

修复offer转预入职bug,手机号区号缺失

heyuan 3 maanden geleden
bovenliggende
commit
7a2d60edaa

+ 2 - 2
websrc/com/kingdee/shr/recuritment/service/offer/ResumeSyncToPEPersonServiceEx.java

@@ -12,10 +12,10 @@ import com.kingdee.shr.attachment.ISHRAttachmentExt;
 import com.kingdee.shr.attachment.SHRAttachmentExtCollection;
 import com.kingdee.shr.attachment.SHRAttachmentExtFactory;
 import com.kingdee.shr.attachment.SHRAttachmentExtInfo;
-import com.kingdee.shr.preentry.PreEntryPersonFactory;
-import com.kingdee.shr.preentry.PreEntryPersonInfo;
+import com.kingdee.shr.preentry.*;
 import com.kingdee.shr.recuritment.*;
 import com.kingdee.shr.recuritment.app.service.ResumeSyncToPEPersonService;
+import com.kingdee.shr.recuritment.utils.RecBaseUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

+ 34 - 12
websrc/com/kingdee/shr/recuritment/service/offer/SyncResumeToPreServiceEx.java

@@ -18,7 +18,6 @@ import com.kingdee.shr.base.syssetting.exception.SHRWebException;
 import com.kingdee.shr.preentry.*;
 import com.kingdee.shr.recuritment.*;
 import com.kingdee.shr.recuritment.app.util.ParamUtil;
-import com.kingdee.shr.recuritment.app.util.db.RecDBUtils;
 import com.kingdee.shr.recuritment.service.recRegister.RecRegisterService;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.log4j.Logger;
@@ -66,19 +65,20 @@ public class SyncResumeToPreServiceEx extends SyncResumeToPreService {
         sorterItemInfo.setSortType(SortType.DESCEND);
         sorterColl.add(sorterItemInfo);
         view.setSorter(sorterColl);
-
+        IRecRegister iRecRegister = RecRegisterFactory.getLocalInstance(ctx);
+        //删除招聘登记记录
+        iRecRegister.delete(filter);
         // 查询招聘登记记录集合
-        RecRegisterCollection coll = RecRegisterFactory.getLocalInstance(ctx).getRecRegisterCollection(view);
-
+        //RecRegisterCollection coll = iRecRegister.getRecRegisterCollection(view);
+        RecRegisterCollection coll = null;
+        //todo 从招聘登记表创建预入职单,有区号为空的bug
         // 如果未查到记录,则尝试通过简历创建新的招聘登记记录并重新查询
-        if (RecDBUtils.isEmpty(coll)) {
-            ResumeBaseRecInfo resumeBaseRecInfo = ResumeBaseRecFactory.getLocalInstance(ctx).getResumeBaseRecInfo("select * where id='" + offer.getResumeBaseRec().getId().toString() + "'");
-            ResumeConvertUtilEx.addRecRegisterByResume(ctx, resumeBaseRecInfo);
-            coll = RecRegisterFactory.getLocalInstance(ctx).getRecRegisterCollection("select *,talent.*,resumeBaseRec.* where resumeBaseRec = '" + offer.getResumeBaseRec().getId().toString() + "' order by createTime desc");
-        }
-
+        //if (RecDBUtils.isEmpty(coll)) {
+//        ResumeBaseRecInfo resumeBaseRecInfo = ResumeBaseRecFactory.getLocalInstance(ctx).getResumeBaseRecInfo("select * where id='" + offer.getResumeBaseRec().getId().toString() + "'");
+//        ResumeConvertUtilEx.addRecRegisterByResume(ctx, resumeBaseRecInfo);
+//        RecRegisterCollection coll = iRecRegister.getRecRegisterCollection("select *,talent.*,resumeBaseRec.* where resumeBaseRec = '" + offer.getResumeBaseRec().getId().toString() + "' order by createTime desc");
+        //}
         PreEntryInfo preEntryInfo = null;
-
         // 处理查询到的招聘登记记录
         if (coll != null && coll.size() > 0) {
             RecRegisterInfo recRegisterInfo = coll.get(0);
@@ -103,7 +103,7 @@ public class SyncResumeToPreServiceEx extends SyncResumeToPreService {
             boolean result = RecRegisterService.getInstance().invalidRegister(ctx, recRegisterInfo);
             if (result) {
                 recRegisterInfo.setRecRegisterState(RecRegisterStateEnum.INVALID);
-                RecRegisterFactory.getLocalInstance(ctx).update(new ObjectUuidPK(recRegisterInfo.getId()), recRegisterInfo);
+                iRecRegister.update(new ObjectUuidPK(recRegisterInfo.getId()), recRegisterInfo);
                 ResumeBaseRecInfo resumeInfo = recRegisterInfo.getResumeBaseRec();
                 resumeInfo.setRecRegisterState(RecRegisterStateEnum.INVALID);
                 ResumeBaseRecFactory.getLocalInstance(ctx).update(new ObjectUuidPK(resumeInfo.getId()), resumeInfo);
@@ -142,6 +142,28 @@ public class SyncResumeToPreServiceEx extends SyncResumeToPreService {
      */
     public void syncResumeToPEPerson(Context ctx, PreEntryPersonInfo person, ResumeBaseRecInfo resume) {
         super.syncResumeToPEPerson(ctx, person, resume);
+        //简历id
+        try {
+            String resumeId = resume.getId().toString();
+            IRecApproval iRecApproval = RecApprovalFactory.getLocalInstance(ctx);
+            RecApprovalCollection recApprovalCollection =
+                    iRecApproval.getRecApprovalCollection("where resumeBaseRec = '" + resumeId + "'");
+            if (!recApprovalCollection.isEmpty()) {
+                //获取招聘审批信息
+                RecApprovalInfo recApprovalInfo = recApprovalCollection.get(0);
+                //获取背调信息
+                String personalScreening = recApprovalInfo.getPersonalScreening();
+                if (StringUtils.isNotBlank(personalScreening)) {
+                    person.put("personalScreening", personalScreening);
+                    SelectorItemCollection updateSic = new SelectorItemCollection();
+                    updateSic.add("personalScreening");
+                    //更新背调信息
+                    PreEntryPersonFactory.getLocalInstance(ctx).updatePartial(person, updateSic);
+                }
+            }
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+        }
         if (person != null) {
             logger.error("***************************同步简历附件到预入职开始***************************");
             //预入职id