huangzhiguo před 1 rokem
rodič
revize
51e1838501

+ 2 - 2
src/main/java/com/caimei/modules/user/dao/CmPortraitDao.java

@@ -22,9 +22,9 @@ public interface CmPortraitDao extends CrudDao<CmPortrait> {
 
     CmPortrait selTotal(CmPortrait cmPortrait);
 
-    List<String> getClubRemarks(Integer clubId, String startTime, String endTime);
+    List<String> getClubRemarks(@Param("clubId") Integer clubId,@Param("startTime") String startTime,@Param("endTime") String endTime);
 
-    List<String> getClubBehavior(Integer clubId, String startTime, String endTime);
+    List<String> getClubBehavior(@Param("clubId") Integer clubId,@Param("startTime") String startTime,@Param("endTime") String endTime);
 
     ClubStatistics selClubData(@Param("clubID") Integer ClubID);
 

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

@@ -154,13 +154,13 @@ public class CmClubRemarks extends DataEntity<CmClubRemarks> {
     // 沟通情况 0 已沟通 1联系不上
     private Integer communicationSituation;
     // 沟通方式 0:电话,微信 1:电话 2:微信
-    private Integer communicationMethods;
+    private String communicationMethods;
     // 客户来源 0 公众号 1 小红书 2 微博 3 搜狐 4 其他
     private Integer customerSource;
     // 客户性别 0 男 1 女
     private Integer customerGender;
     // 客户年龄
-    private Integer customerAge;
+    private String customerAge;
     // 加群情况 0 以加群 1 未加群
     private Integer groupAddition;
 
@@ -479,11 +479,11 @@ public class CmClubRemarks extends DataEntity<CmClubRemarks> {
         this.communicationSituation = communicationSituation;
     }
 
-    public Integer getCommunicationMethods() {
+    public String getCommunicationMethods() {
         return communicationMethods;
     }
 
-    public void setCommunicationMethods(Integer communicationMethods) {
+    public void setCommunicationMethods(String communicationMethods) {
         this.communicationMethods = communicationMethods;
     }
 
@@ -503,11 +503,11 @@ public class CmClubRemarks extends DataEntity<CmClubRemarks> {
         this.customerGender = customerGender;
     }
 
-    public Integer getCustomerAge() {
+    public String getCustomerAge() {
         return customerAge;
     }
 
-    public void setCustomerAge(Integer customerAge) {
+    public void setCustomerAge(String customerAge) {
         this.customerAge = customerAge;
     }
 

+ 15 - 11
src/main/java/com/caimei/modules/user/service/ClubPortraitService.java

@@ -37,6 +37,7 @@ public class ClubPortraitService {
     }
 
     public ClubStatistics clubData(Integer clubID) {
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         ClubStatistics clubStatistics = cmPortraitDao.selClubData(clubID);
         if (clubStatistics != null) {
             String type = "";
@@ -53,17 +54,17 @@ public class ClubPortraitService {
             if (null != clubRemarksInfo) {
                 clubStatistics.setCustomerSource(clubRemarksInfo.getCustomerSource() != null ? clubRemarksInfo.getCustomerSource() : 4);
                 clubStatistics.setGroupAddition(clubRemarksInfo.getGroupAddition() != null ? clubRemarksInfo.getGroupAddition() : 1);
-                clubStatistics.setWxReach(1);
-                if (null != clubRemarksInfo.getCommunicationMethods() && (0 == clubRemarksInfo.getCommunicationMethods() || 2 == clubRemarksInfo.getCommunicationMethods())) {
-                    clubStatistics.setWxReach(0);
-                }
                 clubStatistics.setMobileReach(1);
-                if (null != clubRemarksInfo.getCommunicationMethods() && (0 == clubRemarksInfo.getCommunicationMethods() || 1 == clubRemarksInfo.getCommunicationMethods())) {
+                if (null != clubRemarksInfo.getCommunicationMethods() && clubRemarksInfo.getCommunicationMethods().contains("1")) {
                     clubStatistics.setMobileReach(0);
                 }
+                clubStatistics.setWxReach(1);
+                if (null != clubRemarksInfo.getCommunicationMethods() && clubRemarksInfo.getCommunicationMethods().contains("2")) {
+                    clubStatistics.setWxReach(0);
+                }
                 clubStatistics.setSex(clubRemarksInfo.getCustomerGender() != null ? clubRemarksInfo.getGroupAddition() : null);
                 clubStatistics.setAge(clubRemarksInfo.getCustomerGender() != null ? clubRemarksInfo.getGroupAddition() : null);
-                clubStatistics.setFillTime(clubRemarksInfo.getAddTime().toString());
+                clubStatistics.setFillTime(dateFormat.format(clubRemarksInfo.getAddTime()));
             }
         }
         return clubStatistics;
@@ -80,11 +81,12 @@ public class ClubPortraitService {
         calendar.setTime(time);
         boolean expty = ObjectUtils.isEmpty(demandStart) && ObjectUtils.isEmpty(demandEnd);
         if (expty) {
+            endTime = dateFormat.format(time);
             Date start = null;
             String startTime = "";
             demandEnd = endTime;
             // 日期参数为    日
-            if (1 == dataType || 1 == dataType) {
+            if (1 == dataType) {
                 demandStart = endTime;
             }
             if (2 == dataType) {
@@ -110,35 +112,37 @@ public class ClubPortraitService {
             }
         }
         List<String> demandList = new ArrayList<>();
+        // 咨询记录
         List<String> clubRemarks = cmPortraitDao.getClubRemarks(clubId, demandStart, demandEnd);
         if (clubRemarks.size() > 0) {
             for (String clubRemark : clubRemarks) {
                 if (clubRemark.contains(",")) {
                     String[] split = clubRemark.split(",");
                     for (String s : split) {
-                        if (demandList.size() <= 10) {
+                        if (demandList.size() <= 10 && StringUtils.isNotBlank(s)) {
                             demandList.add(s);
                         }
                     }
                 } else {
-                    if (demandList.size() <= 10) {
+                    if (demandList.size() <= 10 && StringUtils.isNotBlank(clubRemark)) {
                         demandList.add(clubRemark);
                     }
                 }
             }
         }
+        // 访问记录
         List<String> clubBehaviors = cmPortraitDao.getClubBehavior(clubId, demandStart, demandEnd);
         if (clubBehaviors.size() > 0) {
             for (String clubBehavior : clubBehaviors) {
                 if (clubBehavior.contains(",")) {
                     String[] split = clubBehavior.split(",");
                     for (String s : split) {
-                        if (demandList.size() <= 10) {
+                        if (demandList.size() <= 10 && StringUtils.isNotBlank(s)) {
                             demandList.add(s);
                         }
                     }
                 } else {
-                    if (demandList.size() <= 10) {
+                    if (demandList.size() <= 10 && StringUtils.isNotBlank(clubBehavior)) {
                         demandList.add(clubBehavior);
                     }
                 }

+ 4 - 6
src/main/java/com/caimei/modules/user/web/newUser/AgencyController.java

@@ -1723,15 +1723,13 @@ public class AgencyController extends BaseController {
 
     /**
      * 客户需求
-     * @param clubId
-     * @param dataType
-     * @param demandStart
-     * @param demandEnd
+     * @param cmPortrait
      * @return
      */
     @RequestMapping("/getDemandData")
-    public Map<String, Object> getDemandData(Integer clubId, Integer dataType, String demandStart, String demandEnd) {
-        return portraitService.getDemand(clubId, dataType, demandStart, demandEnd);
+    @ResponseBody
+    public Map<String, Object> getDemandData(CmPortrait cmPortrait) {
+        return portraitService.getDemand(cmPortrait.getClubID(), cmPortrait.getDateType(), cmPortrait.getStartTime(), cmPortrait.getEndTime());
     }
 
     /**

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

@@ -84,12 +84,12 @@
          LEFT JOIN city ct ON ct.cityID=c.cityID
          LEFT JOIN province d ON d.provinceID=c.provinceID
          LEFT JOIN (SELECT userID, activeState, customerValue FROM cm_organ_value_system WHERE stage = 0 AND delType = 1) AS covs ON covs.userID = c.userID
-        where clubID = #{clubID}
+        where c.clubID = #{clubID}
     </select>
 
     <select id="getClubRemarksInfo" resultType="com.caimei.modules.user.entity.CmClubRemarks">
         SELECT id, communicationSituation, communicationMethods, customerSource, customerGender, customerAge, groupAddition,addTime
-        FROM cm_club_remarks WHERE clubId = #{clubId} ORDER BY ADDTIME DESC LIMIT 1
+        FROM cm_club_remarks WHERE clubId = #{clubID} ORDER BY ADDTIME DESC LIMIT 1
     </select>
 
     <select id="selOrderList" resultType="com.caimei.modules.order.entity.NewOrder">

+ 117 - 41
src/main/webapp/WEB-INF/views/modules/userNew/cmClubPortrait.jsp

@@ -41,32 +41,67 @@
                         <td>${statistics.clubID}</td>
                         <td>${statistics.linkMan}</td>
                         <td>
-                            <c:if test="${empty not statistics.sex}">
-                                ${statistics.sex == 0 ? '男': '女'}
+                            <c:if test="${not empty statistics.sex}">
+                                ${statistics.sex == '0' ? '男': '女'}
                             </c:if>
                             <c:if test="${empty statistics.sex}">
                                 ---
                             </c:if>
                         </td>
                         <td>
-                            <c:if test="${empty not statistics.age}">
+                            <c:if test="${not empty statistics.age}">
                                 ${statistics.age}
                             </c:if>
                             <c:if test="${empty statistics.age}">
                                 ---
                             </c:if>
                         </td>
-                        <td>${statistics.contractMobile}</td>
-                        <td>${statistics.linkManStatus}</td>
+                        <td>
+                            <c:if test="${not empty statistics.contractMobile}">
+                                ${statistics.contractMobile}
+                            </c:if>
+                            <c:if test="${empty statistics.contractMobile}">
+                                ---
+                            </c:if>
+                        </td>
+                        <td>
+                            <c:if test="${not empty statistics.linkManStatus}">
+                                ${statistics.linkManStatus}
+                            </c:if>
+                            <c:if test="${empty statistics.linkManStatus}">
+                                ---
+                            </c:if>
+                        </td>
                         <td>${statistics.registerTime}</td>
-                        <td>${statistics.customerValues}</td>
-                        <td>${statistics.activeState}</td>
-                        <td>${statistics.clubDataIntegrity}</td>
+                        <td>
+                            <c:if test="${not empty statistics.customerValues}">
+                                ${statistics.customerValues}
+                            </c:if>
+                            <c:if test="${empty statistics.customerValues}">
+                                ---
+                            </c:if>
+                        </td>
+                        <td>
+                            <c:if test="${not empty statistics.activeState}">
+                                ${statistics.activeState}
+                            </c:if>
+                            <c:if test="${empty statistics.activeState}">
+                                ---
+                            </c:if>
+                        </td>
+                        <td>
+                            <c:if test="${not empty statistics.clubDataIntegrity}">
+                                ${statistics.clubDataIntegrity}
+                            </c:if>
+                            <c:if test="${empty statistics.clubDataIntegrity}">
+                                ---
+                            </c:if>
+                        </td>
                         <td>
                             <c:if test="${empty statistics.customerSource}">
                                 ---
                             </c:if>
-                            <c:if test="${empty not statistics.customerSource}">
+                            <c:if test="${not empty statistics.customerSource}">
                                 <c:if test="${statistics.customerSource == 0}">公众号</c:if>
                                 <c:if test="${statistics.customerSource == 1}">小红书</c:if>
                                 <c:if test="${statistics.customerSource == 2}">微博</c:if>
@@ -88,51 +123,92 @@
                         <td>${statistics.clubType}</td>
                     </tr>
                     <tr>
-                        <td>入群状态</td>
-                        <td>微信触达</td>
-                        <td>电话触达</td>
+                        <th>入群状态</th>
+                        <th>微信触达</th>
+                        <th>电话触达</th>
                     </tr>
                     <tr>
-                        <th>
-                            <c:if test="${empty not statistics.groupAddition}">
+                        <td>
+                            <c:if test="${not empty statistics.groupAddition}">
                                 <c:if test="${statistics.groupAddition == 0}">以加群</c:if>
                                 <c:if test="${statistics.groupAddition == 1}">未加群(${statistics.fillTime})</c:if>
                             </c:if>
-
-                        </th>
-                        <th>
-                            <c:if test="${empty not statistics.wxReach}">
+                            <c:if test="${empty statistics.groupAddition}">
+                                ---
+                            </c:if>
+                        </td>
+                        <td>
+                            <c:if test="${not empty statistics.wxReach}">
                                 <c:if test="${statistics.wxReach == 0}">触达</c:if>
                                 <c:if test="${statistics.wxReach == 1}">未触达(${statistics.fillTime})</c:if>
                             </c:if>
-                        </th>
-                        <th>
-                            <c:if test="${empty not statistics.mobileReach}">
+                            <c:if test="${empty statistics.wxReach}">
+                                ---
+                            </c:if>
+                        </td>
+                        <td>
+                            <c:if test="${not empty statistics.mobileReach}">
                                 <c:if test="${statistics.mobileReach == 0}">触达</c:if>
                                 <c:if test="${statistics.mobileReach == 1}">未触达(${statistics.fillTime})</c:if>
                             </c:if>
-                        </th>
+                            <c:if test="${empty statistics.mobileReach}">
+                                ---
+                            </c:if>
+                        </td>
                     </tr>
                     <tr>
-                        <H4 class="H_tag">客户需求</H4>
-                        <div class="box-tabmain">
-                            <div class="box-tabs" id="customerDemand">
-                                <a class="box-tabs-li active" href="javascript: void(0);" data-type="4">全年</a>
-                                <a class="box-tabs-li" href="javascript: void(0);" data-type="3">半年</a>
-                                <a class="box-tabs-li" href="javascript: void(0);" data-type="2">月</a>
-                                <a class="box-tabs-li" href="javascript: void(0);" data-type="1">日</a>
-                            </div>
-                            <div class="box-time" id="customerDemandData">
-                                <div class="time-input">
-                                    <input type="text" placeholder="开始时间" class="input start" id="demandStart">
-                                </div>
-                                <span class="line">至</span>
-                                <div class="time-input">
-                                    <input type="text" placeholder="结束时间" class="input end" id="demandEnd">
+                        <th colspan="8">
+                            <div class="header-content">
+                                <div class="header-box">
+                                    <div class="header-title">
+                                        <H4 class="H_tag">客户需求</H4>
+                                    </div>
+                                    <div class="header-tabmain">
+                                        <div class="header-tabs" id="customerDemand">
+                                            <a class="box-tabs-li active" href="javascript: void(0);" data-type="4">全年</a>
+                                            <a class="box-tabs-li" href="javascript: void(0);" data-type="3">半年</a>
+                                            <a class="box-tabs-li" href="javascript: void(0);" data-type="2">月</a>
+                                            <a class="box-tabs-li" href="javascript: void(0);" data-type="1">日</a>
+                                        </div>
+                                        <div class="header-time" id="customerDemandData">
+                                            <div class="time-input">
+                                                <input type="text" placeholder="开始时间" class="input start" id="demandStart">
+                                            </div>
+                                            <span class="line">至</span>
+                                            <div class="time-input">
+                                                <input type="text" placeholder="结束时间" class="input end" id="demandEnd">
+                                            </div>
+                                        </div><br>
+                                        <div id="demand"></div>
+                                    </div>
                                 </div>
                             </div>
-                        </div>
-                        <div id="demand"></div>
+                            <%--<div class="header-content">
+                                <div class="header-box">
+                                    <div class="header_box-title">
+                                        <H4 class="header_tag">客户需求</H4>
+                                    </div>
+                                    <div class="header_tag_box">
+                                        <div class="header_box-tabs" id="customerDemand">
+                                            <a class="box-tabs-li active" href="javascript: void(0);" data-type="4">全年</a>
+                                            <a class="box-tabs-li" href="javascript: void(0);" data-type="3">半年</a>
+                                            <a class="box-tabs-li" href="javascript: void(0);" data-type="2">月</a>
+                                            <a class="box-tabs-li" href="javascript: void(0);" data-type="1">日</a>
+                                        </div>
+                                        <div class="box-time" id="customerDemandData">
+                                            <div class="time-input">
+                                                <input type="text" placeholder="开始时间" class="input start" id="demandStart">
+                                            </div>
+                                            <span class="line">至</span>
+                                            <div class="time-input">
+                                                <input type="text" placeholder="结束时间" class="input end" id="demandEnd">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div id="demand"></div>
+                                </div>
+                            </div>--%>
+                        </th>
                     </tr>
                 </table>
                 <%--<c:if test="${statistics.name ne null and statistics.name ne ''}">
@@ -269,8 +345,8 @@
                     <H4 class="H_tag">访问记录</H4>
                 </div>
                 <div class="box-title">
-                    <span>所有:<a class="line" href="${ctx}/new/user/agency/regist?clubId=${cmPortrait.clubID}&clubName=${cmPortrait.clubName}"><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" href="javascript:void(0);"></a></span>
+                    <span>所有:<a class="line visitNum" 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 class="visitNum" href="javascript:void(0);"></a></span>
                 </div>
                 <div class="box-tabmain">
                     <div class="box-tabs" id="visitTabs">

+ 14 - 7
src/main/webapp/static/modules/cmClubPortrait/cmClubEacths.js

@@ -52,7 +52,7 @@ const getInfoDemandDate = function () {
             $('#demandEnd').val(s2);
             if (defaultParams.startTime && defaultParams.endTime) {
                 $('#customerDemand').find('a').removeClass('active');
-                getDemandData(0,0)
+                getDemandData(0)
             }
         }
     });
@@ -174,20 +174,27 @@ const getInfoVisitDate = function () {
     });
 }
 const getDemandData = function (dateType) {
+    console.log('客户客户');
+    console.log('url', $('#demandUrl').val(),);
     defaultDemand.dateType = dateType;
-    $({
+    $.ajax({
         url: $('#demandUrl').val(),
         type: "GET",
         data: defaultDemand,
         contentType : 'application/json;charset=UTF-8',
         success: function (data) {
-            if (data.length > 0) {
+            $('#demandStart').val(data.startTime);
+            $('#demandEnd').val(data.endTime);
+            if (data.demandList.length > 0) {
                 $('#demandEnd').val(data.endTime);
                 $('#demandStart').val(data.startTime);
-                $('#demand').html(
-                    data.forEach((item) => {
-                        '<span>${item}</span>'
-                    }))
+                $('#demand').empty();
+                data.demandList.forEach((item) => {
+                    console.log(item)
+                    $('#demand').append('<span class="span_tab">'+ item +'</span>')
+                    // $('.span_tab').append(item)
+                    // $('#demand').append(text)
+                })
             } else {
                 $('#demand').html('<div>暂无数据</div>')
             }

+ 104 - 4
src/main/webapp/static/modules/cmClubPortrait/cmClubPortrait.css

@@ -12,7 +12,7 @@
 }
 .flex-header{
     width: 1446px;
-    height: 40px;
+    height: 540px;
     box-sizing: border-box;
     padding: 0 15px;
 }
@@ -24,7 +24,7 @@
     border-radius: 8px;
     padding: 10px 15px;
 }
-.flex-header-main p{
+.flex-header-main table{
     float: left;
     font-size: 14px;
     line-height: 20px;
@@ -32,14 +32,25 @@
     margin: 0;
     margin-right: 20px;
 }
-.flex-header-main p .icon{
+.flex-header-main table tr{
+    height: 40px;
+}
+.flex-header-main table td{
+    height: 40px;
+    text-align: center;
+}
+/*.flex-header-main table tr th{
+    background-color: #00aef1;
+}*/
+
+.flex-header-main table .icon{
     display: block;
     width: 20px;
     height: 20px;
     float: left;
     margin-right: 4px;
 }
-.flex-header-main p .icon.i1{
+/*.flex-header-main p .icon.i1{
     background: url("./icon/icon-1.png");
     background-size: cover;
 }
@@ -66,6 +77,95 @@
 .flex-header-main p .icon.i7{
     background: url("./icon/icon-7.png");
     background-size: cover;
+}*/
+.header-content{
+    width: 100%;
+    height: 250px;
+    display: flex;
+}
+.header-content .header-box{
+    width: 100%;
+    height: 100%;
+    border:1px solid rgba(192,192,192,0.4);
+    margin-left: 15px;
+    margin-top: 15px;
+    box-shadow: 0px 3px 6px 0px rgb(0,0,0,0.07);
+    padding: 10px;
+    box-sizing: border-box;
+    border-radius: 10px;
+}
+.header-box .header-title{
+    width: 100%;
+    height: 24px;
+    float: left;
+    line-height: 24px;
+    box-sizing: border-box;
+    padding-left: 5px;
+}
+.header-box .header-tabmain{
+    width: 100%;
+    height: 40px;
+    float: left;
+    line-height: 40px;
+}
+.header-box .header-tabmain .header-tabs{
+    float: left;
+    color: #FFFFFF;
+}
+.header-box .header-tabmain .header-tabs .box-tabs-li{
+    margin: 0 5px;
+    color: #FFFFFF;
+}
+.header-box .header-tabmain .box-tabs-li.active{
+    color: #40E0D0;
+}
+.header-box .header-tabmain .header-time{
+    width: 320px;
+    height: 40px;
+    float: right;
+    box-sizing: border-box;
+    padding: 5px 0;
+}
+.header-box .header-tabmain .header-time .time-input{
+    width: 148px;
+    box-sizing: border-box;
+    float: left;
+    position: relative;
+    border-radius: 2px;
+    height: 100%;
+}
+.header-box .header-tabmain .header-time .time-input .input{
+    width: 100%;
+    height: 100%;
+    padding: 0 10px;
+    font-size: 12px;
+    line-height: 30px;
+    border-radius: 2px;
+    cursor: pointer;
+    margin-bottom: 0;
+    box-sizing: border-box;
+    float: left;
+    background: rgba(192,192,192,0.3);
+    border: none;
+    color: #FFFFFF;
+}
+.header-box .header-tabmain .header-time .line{
+    line-height: 30px;
+    font-size: 12px;
+    color: #FFFFFF;
+    margin: 0 5px;
+    display: inline-block;
+    float: left;
+}
+#demand {
+   width: 100%;
+   height: 150px;
+}
+.span_tab {
+    background-color: #ef01f8;
+    color: white;
+    margin-left: 10px;
+    padding: 5px;
 }
 .flex-content{
     width: 100%;

+ 12 - 2
src/main/webapp/static/modules/cmClubPortrait/cmClubPortrait.js

@@ -3,7 +3,7 @@
  */
 $(function(){
     // 机构客户需求初始化时间
-    getDemandData()
+    getInfoDemandDate()
     // 机构订单初始化时间
     getInfoOrderDate();
     // 机构搜索关键词初始化时间
@@ -13,13 +13,15 @@ $(function(){
     // 机构访问记录初始化时间
     getInfoVisitDate();
     // 第一次执行查所有
+    getDemandData(4);
     getClubEacthsData(0,4);
     getClubEacthsData(1,4);
     getClubEacthsData(2,4);
     getClubEacthsData(3,4);
-    // 点击筛选机构订单数据
+    // 点击筛选客户需求数据
     $('#customerDemand').children("a").each(function (index) {
         $(this).click(function () {
+            console.log('客户需求筛选')
             //alert(index);
             $(this).addClass('active').siblings('a').removeClass('active');
             let dateType = $(this).attr('data-type');
@@ -63,4 +65,12 @@ $(function(){
         });
     });
 
+    // 前往新后台
+    $('.visitNum').click(function () {
+        var link = "";
+        $.get("${ctx}/jump/link", function (data) {
+            link = "https://manager.caimei365.com/#/user/record-list?token=" + data;
+            window.open(link, "_blank");
+        });
+    })
 })