Bläddra i källkod

用户行为记录更新

huangzhiguo 1 år sedan
förälder
incheckning
d281506088

+ 20 - 0
src/main/java/com/caimei/modules/user/entity/ClubStatistics.java

@@ -91,6 +91,10 @@ public class ClubStatistics extends DataEntity<ClubStatistics> {
     private Integer mobileReach;    // 电话触达 0 触达 1 未触达
     private String fillTime;    // 填写时间
 
+    private String firstTime;   //首次咨询时间
+
+    private String recentlyTime;    //最近咨询时间
+
 
     public Integer getUserID() {
         return userID;
@@ -627,4 +631,20 @@ public class ClubStatistics extends DataEntity<ClubStatistics> {
     public void setFillTime(String fillTime) {
         this.fillTime = fillTime;
     }
+
+    public String getFirstTime() {
+        return firstTime;
+    }
+
+    public void setFirstTime(String firstTime) {
+        this.firstTime = firstTime;
+    }
+
+    public String getRecentlyTime() {
+        return recentlyTime;
+    }
+
+    public void setRecentlyTime(String recentlyTime) {
+        this.recentlyTime = recentlyTime;
+    }
 }

+ 24 - 0
src/main/java/com/caimei/modules/user/entity/CmClubRemarks.java

@@ -163,6 +163,14 @@ public class CmClubRemarks extends DataEntity<CmClubRemarks> {
     private String customerAge;
     // 加群情况 0 以加群 1 未加群
     private Integer groupAddition;
+    /**
+     * 首次咨询时间
+     */
+    private String firstTime;
+    /**
+     * 最近咨询时间
+     */
+    private String recentlyTime;
 
 
     public Integer getReportID() {
@@ -518,4 +526,20 @@ public class CmClubRemarks extends DataEntity<CmClubRemarks> {
     public void setGroupAddition(Integer groupAddition) {
         this.groupAddition = groupAddition;
     }
+
+    public String getFirstTime() {
+        return firstTime;
+    }
+
+    public void setFirstTime(String firstTime) {
+        this.firstTime = firstTime;
+    }
+
+    public String getRecentlyTime() {
+        return recentlyTime;
+    }
+
+    public void setRecentlyTime(String recentlyTime) {
+        this.recentlyTime = recentlyTime;
+    }
 }

+ 2 - 0
src/main/java/com/caimei/modules/user/service/ClubPortraitService.java

@@ -65,6 +65,8 @@ public class ClubPortraitService {
                 clubStatistics.setSex(clubRemarksInfo.getCustomerGender() != null ? clubRemarksInfo.getGroupAddition() : null);
                 clubStatistics.setAge(StringUtils.isNotBlank(clubRemarksInfo.getCustomerAge()) ? clubRemarksInfo.getCustomerAge() : null);
                 clubStatistics.setFillTime(dateFormat.format(clubRemarksInfo.getAddTime()));
+                clubStatistics.setFirstTime(dateFormat.format(clubRemarksInfo.getFirstTime() != null ? clubRemarksInfo.getFirstTime() : null));
+                clubStatistics.setRecentlyTime(dateFormat.format(clubRemarksInfo.getRecentlyTime() != null ? clubRemarksInfo.getRecentlyTime() : null));
             }
         }
         return clubStatistics;

+ 4 - 1
src/main/resources/mappings/modules/user/CmPortraitMapper.xml

@@ -88,7 +88,10 @@
     </select>
 
     <select id="getClubRemarksInfo" resultType="com.caimei.modules.user.entity.CmClubRemarks">
-        SELECT id, communicationSituation, communicationMethods, customerSource, customerGender, customerAge, groupAddition,addTime
+        SELECT id, communicationSituation, communicationMethods,
+               customerSource, customerGender, customerAge, groupAddition,addTime,
+               (SELECT ADDTIME FROM cm_club_remarks WHERE clubId = 7719 ORDER BY ADDTIME ASC LIMIT 1) AS firstTime,
+               (SELECT ADDTIME FROM cm_club_remarks WHERE clubId = 7719 ORDER BY ADDTIME DESC LIMIT 1) AS recentlyTime
         FROM cm_club_remarks WHERE clubId = #{clubID} ORDER BY ADDTIME DESC LIMIT 1
     </select>
 

+ 33 - 3
src/main/webapp/WEB-INF/views/modules/userNew/cmClubPortrait.jsp

@@ -118,6 +118,8 @@
                     <div class="flex-header-th">入群状态</div>
                     <div class="flex-header-th">微信触达</div>
                     <div class="flex-header-th">电话触达</div>
+                    <div class="flex-header-th">首次咨询时间</div>
+                    <div class="flex-header-th">最近咨询时间</div>
                     <div class="flex-header-th last">机构地址</div>
                 </div>
                 <div class="flex-header-tb">
@@ -161,6 +163,22 @@
                             ---
                         </c:if>
                     </div>
+                    <div class="flex-header-td">
+                        <c:if test="${not empty statistics.firstTime}">
+                            ${statistics.firstTime}
+                        </c:if>
+                        <c:if test="${empty statistics.firstTime}">
+                            ---
+                        </c:if>
+                    </div>
+                    <div class="flex-header-td">
+                        <c:if test="${not empty statistics.recentlyTime}">
+                            ${statistics.recentlyTime}
+                        </c:if>
+                        <c:if test="${empty statistics.recentlyTime}">
+                            ---
+                        </c:if>
+                    </div>
                     <div class="flex-header-td last">
                         ${statistics.province}${statistics.city}${statistics.town}
                     </div>
@@ -305,7 +323,7 @@
                     <H4 class="H_tag">访问记录</H4>
                 </div>
                 <div class="box-title">
-                    <span>所有:<a class="line visit" href="javascript:void(0);"><c:if test="${!empty portrait.visitTotal}">${portrait.visitTotal}</c:if><c:if test="${empty portrait.visitTotal}">0</c:if> 条</a></span>
+                    <span>所有:<a id="visitAll" class="line visit" href="javascript:void(0);"><c:if test="${!empty portrait.visitTotal}">${portrait.visitTotal}</c:if><c:if test="${empty portrait.visitTotal}">0</c:if> 条</a></span>
                     <span class="right_span">当前范围:<a id="visitNum" class="visit" href="javascript:void(0);"></a></span>
                 </div>
                 <div class="box-tabmain">
@@ -344,10 +362,22 @@
 <script type="text/javascript" src="${ctxStatic}/modules/cmClubPortrait/cmClubPortrait.js"></script>
 <script>
     // 前往新后台
-    $('.visit').click(function () {
+    $('#visitNum').click(function () {
+        var link = "";
+        var startTime = $('#visitTimeStart').val()
+        var endTime = $('#visitTimeStart').val()
+        var name = ${statistics.name}
+        $.get("${ctx}/jump/link", function (data) {
+            link = "https://manager.caimei365.com/#/user/record-list?type=second&corporateName="+name+"&startTime="+startTime+"&endTime="+endTime+"&token=" + data;
+            window.open(link, "_blank");
+        });
+    })
+    // 前往新后台
+    $('#visitAll').click(function () {
         var link = "";
+        var name = ${statistics.name}
         $.get("${ctx}/jump/link", function (data) {
-            link = "https://manager.caimei365.com/#/user/record-list?token=" + data;
+            link = "https://manager.caimei365.com/#/user/record-list?type=second&corporateName="+name+"&token=" + data;
             window.open(link, "_blank");
         });
     })