Browse Source

机构画像调试

huangzhiguo 2 years ago
parent
commit
97c2def162

+ 31 - 0
src/main/java/com/caimei/modules/user/entity/ArrDate.java

@@ -0,0 +1,31 @@
+package com.caimei.modules.user.entity;
+
+import java.util.ArrayList;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/2/16
+ */
+public class ArrDate {
+
+    private ArrayList<String> name;
+    private ArrayList<Integer> value;
+
+    public ArrayList<String> getName() {
+        return name;
+    }
+
+    public void setName(ArrayList<String> name) {
+        this.name = name;
+    }
+
+    public ArrayList<Integer> getValue() {
+        return value;
+    }
+
+    public void setValue(ArrayList<Integer> value) {
+        this.value = value;
+    }
+}

+ 17 - 1
src/main/java/com/caimei/modules/user/web/newUser/AgencyController.java

@@ -1414,13 +1414,29 @@ public class AgencyController extends BaseController {
         Map<String, Object> map = Maps.newLinkedHashMap();
         Map<String, Object> map = Maps.newLinkedHashMap();
         try {
         try {
             CmPortrait portrait = portraitService.dataList(cmPortrait);
             CmPortrait portrait = portraitService.dataList(cmPortrait);
+            ArrDate behavior = new ArrDate();
+            ArrDate remarks = new ArrDate();
+            ArrDate pageType = new ArrDate();
+
+            ArrayList<OrderPortrait> orderPortrait = portrait.getOrderPortrait();
+            behavior.setName(portrait.getBehaviorType());
+            behavior.setValue(portrait.getBehaviorValue());
+
+            remarks.setName(portrait.getRemarksType());
+            remarks.setValue(portrait.getRemarksValue());
+
+            pageType.setName(portrait.getPageType());
+            pageType.setValue(portrait.getPageTypeValue());
             map.put("portrait",portrait);
             map.put("portrait",portrait);
+            map.put("behavior",behavior);
+            map.put("remarks",remarks);
+            map.put("pageType",pageType);
+            map.put("orderPortrait",orderPortrait);
             map.put("code",0);
             map.put("code",0);
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
             map.put("code",-1);
             map.put("code",-1);
         }
         }
-
         return map;
         return map;
     }
     }
 
 

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

@@ -16,7 +16,7 @@
         <where>
         <where>
              clubID = #{clubID}
              clubID = #{clubID}
              <if test="accessDate != null and accessDate != ''">
              <if test="accessDate != null and accessDate != ''">
-                 AND orderTime = #{accessDate}
+                 AND orderTime like concat('%',#{accessDate},'%')
              </if>
              </if>
              <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
              <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
                  AND orderTime between #{startTime} and #{endTime}
                  AND orderTime between #{startTime} and #{endTime}
@@ -56,7 +56,7 @@
         <where>
         <where>
             clubID = #{clubID}
             clubID = #{clubID}
             <if test="accessDate != null and accessDate != ''">
             <if test="accessDate != null and accessDate != ''">
-                AND addTime = #{accessDate}
+                AND addTime like concat('%', #{accessDate},'%')
             </if>
             </if>
             <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
             <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
                 AND addTime between #{startTime} and #{endTime}
                 AND addTime between #{startTime} and #{endTime}

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

@@ -145,25 +145,26 @@ const  getClubEacthsData = function (type,dateType) {
         contentType : 'application/json;charset=UTF-8', //contentType很重要
         contentType : 'application/json;charset=UTF-8', //contentType很重要
         success: function (res) {
         success: function (res) {
             console.log('res',res)
             console.log('res',res)
-            if (res.code === 0) {
+            if (res.portrait.code === 0) {
+                let data = res.portrait
                 if(type === 0){
                 if(type === 0){
-                    if(res.portrait.orderPortrait){
-                        let  data = res.portrait.orderPortrait;
+                    if(data.orderPortrait){
+                        let  data = data.orderPortrait;
                         getOrderEacths(data)
                         getOrderEacths(data)
                     }else{
                     }else{
                         $('#orderEacthsNone').show();
                         $('#orderEacthsNone').show();
                         $('#orderEacths').hide();
                         $('#orderEacths').hide();
                     }
                     }
                 }else{
                 }else{
-                    if(!res.portrait.behaviorType){
+                    if(!data.behavior){
                         $('#keyWordsEacthsNone').show();
                         $('#keyWordsEacthsNone').show();
                         $('#keyWordsEacths').hide();
                         $('#keyWordsEacths').hide();
                     }
                     }
-                    if(!res.portrait.behaviorType){
+                    if(!data.remarks){
                         $('#serviceEacthsNone').show();
                         $('#serviceEacthsNone').show();
                         $('#serviceEacths').hide();
                         $('#serviceEacths').hide();
                     }
                     }
-                    if(!res.portrait.behaviorType){
+                    if(!data.pageType){
                         $('#visitEacthsNone').show();
                         $('#visitEacthsNone').show();
                         $('#visitEacths').hide();
                         $('#visitEacths').hide();
                     }
                     }
@@ -172,24 +173,24 @@ const  getClubEacthsData = function (type,dateType) {
                             id:'keyWordsEacths',
                             id:'keyWordsEacths',
                             color:'#e15616',
                             color:'#e15616',
                             series:{
                             series:{
-                                yAxisData:res.portrait.behaviorType ? res.portrait.behaviorType : [],
-                                seriesData:res.portrait.behaviorValue ? res.portrait.behaviorValue : []
+                                yAxisData:data.behavior.name,
+                                seriesData:data.behavior.value
                             },
                             },
                         },
                         },
                         2:{
                         2:{
                             id:'serviceEacths',
                             id:'serviceEacths',
                             color:'#36cbcb',
                             color:'#36cbcb',
                             series:{
                             series:{
-                                yAxisData:['M22', '玻尿酸', '超声刀', '面膜', '耗材', '润月雅', 'Ross', '超声跑', '拗口似','是脚手'],
-                                seriesData:[1000, 2000, 3000, 4000, 5000, 6000,7000,8000,9000,10000]
+                                yAxisData:data.remarks.name,
+                                seriesData:data.remarks.value
                             },
                             },
                         },
                         },
                         3:{
                         3:{
                             id:'visitEacths',
                             id:'visitEacths',
                             color:'#3aa0ff',
                             color:'#3aa0ff',
                             series:{
                             series:{
-                                yAxisData:['搜索供应商', '楼层详情', '新品橱窗', '文章列表', '供应商主页', '二手列表','个人中心','新商品详情','商品搜索','首页'],
-                                seriesData:[1000, 2000, 3000, 4000, 5000, 6000,7000,8000,9000,10000]
+                                yAxisData:data.remarks.name,
+                                seriesData:data.remarks.value
                             },
                             },
                         }
                         }
                     }
                     }