Browse Source

客户档案汇总新增公共面谈信息汇总

anderx 8 months ago
parent
commit
9a69f48db9

+ 9 - 0
src/main/java/com/goafanti/Interview/bo/selectByUidAidBo.java

@@ -5,6 +5,15 @@ import com.goafanti.common.model.UserArchivesInterview;
 public class selectByUidAidBo extends UserArchivesInterview {
 
     private Integer prStatus;
+    private String adminName;
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
 
     public Integer getPrStatus() {
         return prStatus;

+ 3 - 2
src/main/java/com/goafanti/Interview/service/impl/UserArchivesInterviewServiceImpl.java

@@ -2,6 +2,7 @@ package com.goafanti.Interview.service.impl;
 
 import com.goafanti.Interview.bo.OutPublicAidUid;
 import com.goafanti.Interview.bo.UpdateUserBo;
+import com.goafanti.Interview.bo.selectByUidAidBo;
 import com.goafanti.Interview.service.UserArchivesInterviewService;
 import com.goafanti.common.dao.*;
 import com.goafanti.common.model.*;
@@ -168,7 +169,7 @@ public class UserArchivesInterviewServiceImpl extends BaseMybatisDao<UserArchive
 
 
     private void addUserArchivesInterview(UpdateUserBo in) {
-        List<UserArchivesInterview> list = userArchivesInterviewMapper.selectByUidAid(in.getUid(), in.getAid());
+        List<selectByUidAidBo> list = userArchivesInterviewMapper.selectByUidAid(in.getUid(), in.getAid());
         UserArchivesInterview userArchivesInterview = new UserArchivesInterview();
         if (list.isEmpty()){
             userArchivesInterview.setCounts(1);
@@ -227,7 +228,7 @@ public class UserArchivesInterviewServiceImpl extends BaseMybatisDao<UserArchive
         UserArchivesInterview uai = userArchivesInterviewMapper.selectByPrdid(prdid);
         if (uai!=null){
             res.put("data",uai);
-            List<UserArchivesInterview> list = userArchivesInterviewMapper.selectByUidAid(uai.getUid(), uai.getAid());
+            List<selectByUidAidBo> list = userArchivesInterviewMapper.selectByUidAid(uai.getUid(), uai.getAid());
             res.put("list",list);
         }
         return res;

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

@@ -1,5 +1,6 @@
 package com.goafanti.common.dao;
 
+import com.goafanti.Interview.bo.selectByUidAidBo;
 import com.goafanti.common.model.UserArchivesInterview;
 import org.apache.ibatis.annotations.Param;
 
@@ -78,7 +79,7 @@ public interface UserArchivesInterviewMapper {
      * @return 影响行数
      */
     int deleteById(Integer id);
-    List<UserArchivesInterview> selectByUidAid(@Param("uid") String uid, @Param("aid") String aid);
+    List<selectByUidAidBo> selectByUidAid(@Param("uid") String uid, @Param("aid") String aid);
 
     List<UserArchivesInterview> selectByIds(String[] split1);
 

+ 3 - 2
src/main/java/com/goafanti/common/mapper/UserArchivesInterviewMapper.xml

@@ -240,13 +240,14 @@
         <result property="followUpPlan" column="follow_up_plan" jdbcType="VARCHAR"/>
         <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
         <result property="prStatus" column="prStatus" jdbcType="INTEGER"/>
+        <result property="adminName" column="name" jdbcType="VARCHAR"/>
     </resultMap>
 
     <select id="selectByUidAid" resultMap="selectByUidAidBoMap">
     select
-    a.* ,c.status prStatus
+    a.* ,c.status prStatus,d.name
     from user_archives_interview a left join public_release_details b on a.prdid=b.id
-    left join public_release c on b.prid=c.id
+    left join public_release c on b.prid=c.id left join admin d on a.aid=d.id
     <where>
     <if test="uid != null and uid != ''">
         and a.uid = #{uid}

+ 0 - 1
src/main/java/com/goafanti/customer/bo/InputSelectUserArchives.java

@@ -5,7 +5,6 @@ public class InputSelectUserArchives {
     private Integer newChannel;
     private String name;
     private String aid;
-
     private String  channelType;
     private String  businessScope;
     private String  industry;

+ 1 - 0
src/main/java/com/goafanti/customer/bo/OutSelectUserArchives.java

@@ -94,6 +94,7 @@ public class OutSelectUserArchives {
     private String depName;
     @Excel(name = "修改时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date updateTime;
+    @Excel(name = "公出面谈信息")
     private String publicContent;
 
     public Integer getStandard() {

+ 4 - 4
src/main/java/com/goafanti/customer/bo/UserArchivesDetails.java

@@ -1,8 +1,8 @@
 package com.goafanti.customer.bo;
 
+import com.goafanti.Interview.bo.selectByUidAidBo;
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.UserArchives;
-import com.goafanti.common.model.UserArchivesInterview;
 import com.goafanti.common.model.UserInterviewProjectBo;
 
 import java.util.List;
@@ -82,13 +82,13 @@ public class UserArchivesDetails extends UserArchives {
         LocationArea = locationArea;
     }
 
-    private List<UserArchivesInterview> interviewList;
+    private List<selectByUidAidBo> interviewList;
 
-    public List<UserArchivesInterview> getInterviewList() {
+    public List<selectByUidAidBo> getInterviewList() {
         return interviewList;
     }
 
-    public void setInterviewList(List<UserArchivesInterview> interviewList) {
+    public void setInterviewList(List<selectByUidAidBo> interviewList) {
         this.interviewList = interviewList;
     }
 

+ 33 - 3
src/main/java/com/goafanti/customer/service/impl/UserArchivesServiceImpl.java

@@ -1,8 +1,10 @@
 package com.goafanti.customer.service.impl;
 
+import com.goafanti.Interview.bo.selectByUidAidBo;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.*;
 import com.goafanti.common.model.*;
+import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -109,7 +111,7 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
         }
         BeanUtils.copyProperties(userArchives, user);
         user.setUid(id);
-        List<UserArchivesInterview> userArchivesInterviews;
+        List<selectByUidAidBo> userArchivesInterviews;
         if (type==0){
             userArchivesInterviews = userArchivesInterviewMapper.selectByUidAid(id, TokenManager.getAdminId());
             user.setInterviewList(userArchivesInterviews);
@@ -318,9 +320,33 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
     @Override
     public Object selectUserArchives(InputSelectUserArchives in) {
         Map<String, Object> params = getParams(in);
-
-        return findPage("selectUserArchivesList",
+        Pagination<?> page = findPage("selectUserArchivesList",
                 "selectUserArchivesCount", params, in.getPageNo(), in.getPageSize());
+//        List<OutSelectUserArchives> list = (List<OutSelectUserArchives>) page.getList();
+//                 list.stream().forEach(e ->{
+//                     List<selectByUidAidBo> userArchivesInterviews = userArchivesInterviewMapper.selectByUidAid(e.getId(), null);
+//                     e.setPublicContent(pushContent(userArchivesInterviews));
+//                 });
+        return page;
+    }
+
+    private String pushContent(List<selectByUidAidBo> list) {
+        if (!list.isEmpty()){
+            StringBuilder builder = new StringBuilder();
+            list.stream().forEach(e ->{
+                builder.append(e.getAdminName()).append( "[").append(DateUtils.formatDateChineseYYYYMMddHH(e.getCreateTime())).append("]:");
+                builder.append("前期沟通-客户的难处:").append(e.getEarlyCommunication()).append("\n");
+                builder.append("客户的需求:").append(e.getCustomerDemand()).append("\n");
+                builder.append("面谈思路:").append(e.getInterviewIdeas()).append("\n");
+                builder.append("面谈达成的目的:").append(e.getInterviewPurpose()).append("\n");
+                builder.append("经理/上级面谈建议:").append(e.getInterviewRecommend()).append("\n");
+                if (e.getInterviewFeedback()!=null)builder.append("面谈的反馈:").append(e.getInterviewFeedback()).append("\n");
+                if (e.getFollowUpPlan()!=null)builder.append("后续计划:").append(e.getFollowUpPlan()).append("\n");
+                builder.append("\n");
+            });
+            return builder.toString();
+        }
+        return null;
     }
 
     private Map<String, Object> getParams(InputSelectUserArchives in) {
@@ -371,6 +397,10 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
         Map<String, Object> params = getParams(in);
         List<OutSelectUserArchives> list= (List<OutSelectUserArchives>) findList("selectUserArchivesList",
                 params, 1, 999999);
+        list.stream().forEach(e ->{
+            List<selectByUidAidBo> userArchivesInterviews = userArchivesInterviewMapper.selectByUidAid(e.getId(), null);
+            e.setPublicContent(pushContent(userArchivesInterviews));
+        });
         NewExcelUtil<OutSelectUserArchives> newExcelUtil = new NewExcelUtil<>(OutSelectUserArchives.class);
         return newExcelUtil.exportExcel( list,"用户档案",uploadPath);
     }