Przeglądaj źródła

登录接口添加同步跟进信息

LiFei 6 lat temu
rodzic
commit
ff255fe460

+ 8 - 9
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/hpresume/entity/CmCandidateContactDetailcm.java

@@ -21,8 +21,8 @@ public class CmCandidateContactDetailcm extends DataEntity<CmCandidateContactDet
 	private Integer candidateTrackId;		// 候选人追踪追主键
 	private String contactPerson;		// 跟进人(主要是后台客服)
 	private Date contactTime;		// 跟进时间
-	private String contactType;		// 跟进方式(0:电话 1:微信 2:QQ 3:短信 4:其他)
-	private String contactStatus;		// 跟进状态(0:正在跟进 1:暂停跟进 2:重点跟进)
+	private Integer contactType;		// 跟进方式(0:电话 1:微信 2:QQ 3:短信 4:其他)
+	private Integer contactStatus;		// 跟进状态(0:正在跟进 1:暂停跟进 2:重点跟进)
 	private String contactContent;		// 跟进内容
 	
 
@@ -63,24 +63,23 @@ public class CmCandidateContactDetailcm extends DataEntity<CmCandidateContactDet
 	public void setContactTime(Date contactTime) {
 		this.contactTime = contactTime;
 	}
-	
-	public String getContactType() {
+
+	public Integer getContactType() {
 		return contactType;
 	}
 
-	public void setContactType(String contactType) {
+	public void setContactType(Integer contactType) {
 		this.contactType = contactType;
 	}
 
-	@ExcelField(title="跟进状态(0:正在跟进 1:暂停跟进 2:重点跟进)", align=2, sort=5)
-	public String getContactStatus() {
+	public Integer getContactStatus() {
 		return contactStatus;
 	}
 
-	public void setContactStatus(String contactStatus) {
+	public void setContactStatus(Integer contactStatus) {
 		this.contactStatus = contactStatus;
 	}
-	
+
 	@ExcelField(title="跟进内容", align=2, sort=6)
 	public String getContactContent() {
 		return contactContent;

+ 3 - 0
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/hpresume/mapper/HpResumeBankMapper.java

@@ -6,6 +6,7 @@ package com.jeeplus.modules.hpresume.mapper;
 import com.jeeplus.core.persistence.BaseMapper;
 import com.jeeplus.core.persistence.annotation.MyBatisMapper;
 import com.jeeplus.modules.hpresume.entity.CmCandidateBelongDetailcm;
+import com.jeeplus.modules.hpresume.entity.CmCandidateContactDetailcm;
 import com.jeeplus.modules.hpresume.entity.CmCandidateTrackcm;
 import com.jeeplus.modules.hpresume.entity.HpResumeBank;
 
@@ -20,4 +21,6 @@ public interface HpResumeBankMapper extends BaseMapper<HpResumeBank> {
     void saveCmCandidateTrack(CmCandidateTrackcm cmCandidateTrack);
 
     void saveCmCandidateBelongDetail(CmCandidateBelongDetailcm cmCandidateBelongDetail);
+
+    void savecmCandidateContactDetail(CmCandidateContactDetailcm cmCandidateContactDetailcm);
 }

+ 21 - 0
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/hpresume/mapper/xml/HpResumeBankMapper.xml

@@ -255,4 +255,25 @@
 			#{belongReason}
 		)
 	</insert>
+
+
+
+	<!--保存候选人跟进明细-->
+	<insert id="savecmCandidateContactDetail" keyProperty="id" useGeneratedKeys="true" parameterType="CmCandidateContactDetailcm">
+		INSERT INTO cm_candidate_contact_detail(
+			candidate_track_id,
+			contact_person,
+			contact_time,
+			contact_type,
+			contact_status,
+			contact_content
+		) VALUES (
+			#{candidateTrackId},
+			#{contactPerson},
+			#{contactTime},
+			#{contactType},
+			#{contactStatus},
+			#{contactContent}
+		)
+	</insert>
 </mapper>

+ 31 - 0
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/sys/service/HpUserService.java

@@ -19,6 +19,7 @@ import com.jeeplus.modules.dpenterprise.service.DpEnterpriseAuthenticationServic
 import com.jeeplus.modules.hpmessage.entity.HpMessage;
 import com.jeeplus.modules.hpmessage.service.HpMessageService;
 import com.jeeplus.modules.hpresume.entity.CmCandidateBelongDetailcm;
+import com.jeeplus.modules.hpresume.entity.CmCandidateContactDetailcm;
 import com.jeeplus.modules.hpresume.entity.CmCandidateTrackcm;
 import com.jeeplus.modules.hpresume.mapper.HpResumeBankMapper;
 import com.jeeplus.modules.hpuser.entity.HpApplyPosition;
@@ -1418,6 +1419,36 @@ public class HpUserService extends CrudService<HpUserMapper, HpUser> {
             cmCandidateBelongDetail.setBelongTime(new Date());
 
             hpResumeBankMapper.saveCmCandidateBelongDetail(cmCandidateBelongDetail);
+
+            //如果有跟进信息就同步到crm跟进明细表
+            if(StringUtils.isNotBlank(hpMember.getContactPerson())){
+                List<HpUserContact> list=hpUserContactService.findListByUserId(hpUser1.getId());
+                if(list.size()>0){
+                    for (int i = 0; i <list.size() ; i++) {
+                        CmCandidateContactDetailcm cmCandidateContactDetailcm=new CmCandidateContactDetailcm();
+                        if(StringUtils.isNotBlank(cmCandidateTrack.getId())){
+                            cmCandidateContactDetailcm.setCandidateTrackId(Integer.parseInt(cmCandidateTrack.getId()));
+                        }
+                        cmCandidateContactDetailcm.setContactPerson(list.get(i).getContactUser());
+                        cmCandidateContactDetailcm.setContactTime(list.get(i).getContactTime());
+                        cmCandidateContactDetailcm.setContactType(0);
+                        contactStatus=list.get(i).getContactStatus();
+                        if(contactStatus!=null){
+                            if(contactStatus==5){
+                                cmCandidateContactDetailcm.setContactStatus(1);
+                            }else if(contactStatus==4 || contactStatus==0){
+                                cmCandidateContactDetailcm.setContactStatus(0);
+                            }else if(contactStatus==2 || contactStatus==1 || contactStatus==3  ){
+                                cmCandidateContactDetailcm.setContactStatus(2);
+                            }else{
+                                cmCandidateContactDetailcm.setContactStatus(-1);
+                            }
+                        }
+                        cmCandidateContactDetailcm.setContactContent(list.get(i).getContactContent());
+                        hpResumeBankMapper.savecmCandidateContactDetail(cmCandidateContactDetailcm);
+                    }
+                }
+            }
             //将业务表跟member表信息关联
             hpMemberService.mergeInfo(hpUser1.getId(), userIds, hpMember.getId());
         }