Browse Source

更新企业档案与面谈接口修改

anderx 9 months ago
parent
commit
5cf8cd81d0

+ 1 - 0
src/main/java/com/goafanti/common/dao/UserArchivesInterviewMapper.java

@@ -80,5 +80,6 @@ public interface UserArchivesInterviewMapper {
     int deleteById(Integer id);
     List<UserArchivesInterview> selectByUidAid(@Param("uid") String uid, @Param("aid") String aid);
 
+    List<UserArchivesInterview> selectByIds(String[] split1);
 }
 

+ 40 - 42
src/main/java/com/goafanti/common/mapper/UserArchivesInterviewMapper.xml

@@ -6,7 +6,7 @@
         <result property="id" column="id" jdbcType="INTEGER"/>
         <result property="uid" column="uid" jdbcType="VARCHAR"/>
         <result property="aid" column="aid" jdbcType="VARCHAR"/>
-        <result property="peid" column="peid" jdbcType="VARCHAR"/>
+        <result property="prdid" column="prdid" jdbcType="INTEGER"/>
         <result property="counts" column="counts" jdbcType="INTEGER"/>
         <result property="earlyCommunication" column="early_communication" jdbcType="VARCHAR"/>
         <result property="customerDemand" column="customer_demand" jdbcType="VARCHAR"/>
@@ -16,60 +16,51 @@
         <result property="interviewFeedback" column="interview_feedback" jdbcType="VARCHAR"/>
         <result property="followUpPlan" column="follow_up_plan" jdbcType="VARCHAR"/>
     </resultMap>
-
+    
     <sql id="UserArchivesInterviewAllSql">
-        id, uid, aid, peid, counts, early_communication, customer_demand, interview_ideas, interview_purpose, interview_recommend, interview_feedback, follow_up_plan
+id, uid, aid, prdid, counts, early_communication, customer_demand, interview_ideas, interview_purpose, interview_recommend, interview_feedback, follow_up_plan        
     </sql>
 
     <!--查询单个-->
     <select id="selectById" resultMap="UserArchivesInterviewMap">
         select
-        <include refid="UserArchivesInterviewAllSql"/>
+          <include refid="UserArchivesInterviewAllSql"/>
         from user_archives_interview
         where id = #{id}
     </select>
 
     <!--新增所有列-->
     <insert id="insert" keyProperty="id" useGeneratedKeys="true">
-        insert into user_archives_interview(uid, aid, peid, counts, early_communication, customer_demand,
-                                            interview_ideas, interview_purpose, interview_recommend, interview_feedback,
-                                            follow_up_plan)
-        values (#{uid}, #{aid}, #{peid}, #{counts}, #{earlyCommunication}, #{customerDemand}, #{interviewIdeas},
-                #{interviewPurpose}, #{interviewRecommend}, #{interviewFeedback}, #{followUpPlan})
+        insert into user_archives_interview(uid, aid, prdid, counts, early_communication, customer_demand, interview_ideas, interview_purpose, interview_recommend, interview_feedback, follow_up_plan)
+        values (#{uid}, #{aid}, #{prdid}, #{counts}, #{earlyCommunication}, #{customerDemand}, #{interviewIdeas}, #{interviewPurpose}, #{interviewRecommend}, #{interviewFeedback}, #{followUpPlan})
     </insert>
 
     <insert id="insertBatch">
-        insert into user_archives_interview(uid, aid, peid, counts, early_communication, customer_demand,
-        interview_ideas, interview_purpose, interview_recommend, interview_feedback, follow_up_plan)
+        insert into user_archives_interview(uid, aid, prdid, counts, early_communication, customer_demand, interview_ideas, interview_purpose, interview_recommend, interview_feedback, follow_up_plan)
         values
         <foreach collection="entities" item="entity" separator=",">
-            (#{entity.uid}, #{entity.aid}, #{entity.peid}, #{entity.counts}, #{entity.earlyCommunication},
-            #{entity.customerDemand}, #{entity.interviewIdeas}, #{entity.interviewPurpose},
-            #{entity.interviewRecommend}, #{entity.interviewFeedback}, #{entity.followUpPlan})
+        (#{entity.uid}, #{entity.aid}, #{entity.prdid}, #{entity.counts}, #{entity.earlyCommunication}, #{entity.customerDemand}, #{entity.interviewIdeas}, #{entity.interviewPurpose}, #{entity.interviewRecommend}, #{entity.interviewFeedback}, #{entity.followUpPlan})
         </foreach>
     </insert>
 
     <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
-        insert into user_archives_interview(uid, aid, peid, counts, early_communication, customer_demand,
-        interview_ideas, interview_purpose, interview_recommend, interview_feedback, follow_up_plan)
+        insert into user_archives_interview(uid, aid, prdid, counts, early_communication, customer_demand, interview_ideas, interview_purpose, interview_recommend, interview_feedback, follow_up_plan)
         values
         <foreach collection="entities" item="entity" separator=",">
-            (#{entity.uid}, #{entity.aid}, #{entity.peid}, #{entity.counts}, #{entity.earlyCommunication},
-            #{entity.customerDemand}, #{entity.interviewIdeas}, #{entity.interviewPurpose},
-            #{entity.interviewRecommend}, #{entity.interviewFeedback}, #{entity.followUpPlan})
+            (#{entity.uid}, #{entity.aid}, #{entity.prdid}, #{entity.counts}, #{entity.earlyCommunication}, #{entity.customerDemand}, #{entity.interviewIdeas}, #{entity.interviewPurpose}, #{entity.interviewRecommend}, #{entity.interviewFeedback}, #{entity.followUpPlan})
         </foreach>
         on duplicate key update
-        uid = values(uid),
-        aid = values(aid),
-        peid = values(peid),
-        counts = values(counts),
-        early_communication = values(early_communication),
-        customer_demand = values(customer_demand),
-        interview_ideas = values(interview_ideas),
-        interview_purpose = values(interview_purpose),
-        interview_recommend = values(interview_recommend),
-        interview_feedback = values(interview_feedback),
-        follow_up_plan = values(follow_up_plan)
+uid = values(uid),
+aid = values(aid),
+prdid = values(prdid),
+counts = values(counts),
+early_communication = values(early_communication),
+customer_demand = values(customer_demand),
+interview_ideas = values(interview_ideas),
+interview_purpose = values(interview_purpose),
+interview_recommend = values(interview_recommend),
+interview_feedback = values(interview_feedback),
+follow_up_plan = values(follow_up_plan)
     </insert>
 
     <!--通过主键修改数据-->
@@ -82,8 +73,8 @@
             <if test="aid != null and aid != ''">
                 aid = #{aid},
             </if>
-            <if test="peid != null and peid != ''">
-                peid = #{peid},
+            <if test="prdid != null">
+                prdid = #{prdid},
             </if>
             <if test="counts != null">
                 counts = #{counts},
@@ -112,11 +103,11 @@
         </set>
         where id = #{id}
     </update>
-
+    
     <!--查询指定行数据-->
     <select id="findUserArchivesInterviewList" resultMap="UserArchivesInterviewMap">
         select
-        <include refid="UserArchivesInterviewAllSql"/>
+          <include refid="UserArchivesInterviewAllSql"/>
 
         from user_archives_interview
         <where>
@@ -129,8 +120,8 @@
             <if test="aid != null and aid != ''">
                 and aid = #{aid}
             </if>
-            <if test="peid != null and peid != ''">
-                and peid = #{peid}
+            <if test="prdid != null">
+                and prdid = #{prdid}
             </if>
             <if test="counts != null">
                 and counts = #{counts}
@@ -158,7 +149,7 @@
             </if>
         </where>
         <if test="page_sql != null">
-            ${page_sql}
+    		${page_sql}
         </if>
     </select>
 
@@ -176,8 +167,8 @@
             <if test="aid != null and aid != ''">
                 and aid = #{aid}
             </if>
-            <if test="peid != null and peid != ''">
-                and peid = #{peid}
+            <if test="prdid != null">
+                and prdid = #{prdid}
             </if>
             <if test="counts != null">
                 and counts = #{counts}
@@ -208,9 +199,7 @@
 
     <!--通过主键删除-->
     <delete id="deleteById">
-        delete
-        from user_archives_interview
-        where id = #{id}
+        delete from user_archives_interview where id = #{id}
     </delete>
 
     <select id="selectByUidAid" resultMap="UserArchivesInterviewMap">
@@ -227,5 +216,14 @@
     </where>
     order by counts desc
     </select>
+    <select id="selectByIds" resultMap="UserArchivesInterviewMap">
+        select
+        <include refid="UserArchivesInterviewAllSql"/>
+        from user_archives_interview
+        where id in
+        <foreach collection="array" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </select>
 </mapper>
 

+ 18 - 18
src/main/java/com/goafanti/common/model/UserArchivesInterview.java

@@ -7,53 +7,53 @@ import java.io.Serializable;
  * 客户档案面谈表(UserArchivesInterview)实体类
  *
  * @author makejava
- * @since 2025-04-14 15:32:37
+ * @since 2025-04-16 14:34:42
  */
 public class UserArchivesInterview implements Serializable {
-    private static final long serialVersionUID = 382191035047524796L;
+    private static final long serialVersionUID = 614698214125053643L;
 
     private Integer id;
-    /**
+/**
      * 客户编号
      */
     private String uid;
-    /**
+/**
      * 跟进人编号
      */
     private String aid;
-    /**
+/**
      * 公出编号
      */
-    private String peid;
-    /**
+    private Integer prdid;
+/**
      * 次数
      */
     private Integer counts;
-    /**
+/**
      * 前期沟通-客户的难处
      */
     private String earlyCommunication;
-    /**
+/**
      * 客户的需求
      */
     private String customerDemand;
-    /**
+/**
      * 面谈思路
      */
     private String interviewIdeas;
-    /**
+/**
      * 面谈达成的目的
      */
     private String interviewPurpose;
-    /**
+/**
      * 经理/上级面谈建议
      */
     private String interviewRecommend;
-    /**
+/**
      * 面谈后反馈
      */
     private String interviewFeedback;
-    /**
+/**
      * 后续跟进计划
      */
     private String followUpPlan;
@@ -83,12 +83,12 @@ public class UserArchivesInterview implements Serializable {
         this.aid = aid;
     }
 
-    public String getPeid() {
-        return peid;
+    public Integer getPrdid() {
+        return prdid;
     }
 
-    public void setPeid(String peid) {
-        this.peid = peid;
+    public void setPrdid(Integer prdid) {
+        this.prdid = prdid;
     }
 
     public Integer getCounts() {

+ 10 - 0
src/main/java/com/goafanti/weChat/bo/InputPublicRelease.java

@@ -65,6 +65,16 @@ public class InputPublicRelease extends PublicRelease {
 
 	private String uid;
 
+	private String uais;
+
+	public String getUais() {
+		return uais;
+	}
+
+	public void setUais(String uais) {
+		this.uais = uais;
+	}
+
 	public String getUid() {
 		return uid;
 	}

+ 17 - 0
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -99,6 +99,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	private PublicConfigMapper publicConfigMapper;
 	@Autowired
 	private UserFirstInterviewMapper userFirstInterviewMapper;
+	@Autowired
+	private UserArchivesInterviewMapper userArchivesInterviewMapper;
 
 	@Override
 	@Transactional
@@ -138,6 +140,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		}
 		addPRD(in, users, str, prdList);
 		addPublicReleaseDateClock(in);
+		pushUserArchivesInterview(in);
 		String userNames=str.substring(0,str.length()-1);
 		in.setUserNames(userNames);
 		PublicRelease updateName=new PublicRelease();
@@ -149,7 +152,21 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		return (Map<String, Object>) addPublicReleaseLog(my, in,userNames,date,users,checkOrderNo);
 	}
 
+	private void pushUserArchivesInterview(InputPublicRelease in) {
+		String[] split1 = in.getUais().split(",");
+		List<UserArchivesInterview> userArchivesInterviews = userArchivesInterviewMapper.selectByIds(split1);
+		List<OutPublicReleaseDetails> outPublicReleaseDetails = publicReleaseDetailsMapper.selectByPrid(in.getId());
+		for (OutPublicReleaseDetails e : outPublicReleaseDetails) {
+			for (UserArchivesInterview uai : userArchivesInterviews) {
+				if (e.getUid().equals(uai.getUid())){
+					uai.setPrdid(e.getId());
+				}
+			}
+		}
+	}
+
 	private void addPRD(InputPublicRelease in, List<User> users, StringBuilder str, List<PublicReleaseDetails> prdList) {
+
 		if (in.getUids()!=null){
 			List<String> split = Arrays.asList(in.getUids().split(","));
 			int userCount=split.size();