傅行帆 před 5 roky
rodič
revize
ce0fa40edf

+ 1
- 1
src/main/java/com/huiju/estateagents/statistic/controller/TsCustomerStatisticDailyController.java Zobrazit soubor

@@ -170,7 +170,7 @@ public class TsCustomerStatisticDailyController extends BaseController {
170 170
         }
171 171
         TaPerson person = taPersons.get(0);
172 172
         try {
173
-            List<TsCustomerStatisticDaily> list = iTaCustomerStatisticDailyService.getDailyList(customerType,getOrgId(request),person.getPersonId());
173
+            List<TsCustomerStatisticDaily> list = iTaCustomerStatisticDailyService.getDailyList(customerType,getOrgId(request),person.getPersonId(),person.getUserId());
174 174
             responseBean.addSuccess(list);
175 175
         }catch (Exception e){
176 176
             e.printStackTrace();

+ 1
- 1
src/main/java/com/huiju/estateagents/statistic/controller/TsCustomerStatisticMonthlyController.java Zobrazit soubor

@@ -171,7 +171,7 @@ public class TsCustomerStatisticMonthlyController extends BaseController {
171 171
         TaPerson person = taPersons.get(0);
172 172
         try {
173 173
             //查询月客户分析数据
174
-            List<TsCustomerStatisticMonthly> result = iTaCustomerStatisticMonthlyService.getCustomerMonthlyList(customerType, getOrgId(request),person.getPersonId());
174
+            List<TsCustomerStatisticMonthly> result = iTaCustomerStatisticMonthlyService.getCustomerMonthlyList(customerType, getOrgId(request),person.getPersonId(),person.getUserId());
175 175
             responseBean.addSuccess(result);
176 176
         }catch (Exception e){
177 177
             e.printStackTrace();

+ 2
- 1
src/main/java/com/huiju/estateagents/statistic/mapper/TsCustomerStatisticDailyMapper.java Zobrazit soubor

@@ -49,9 +49,10 @@ public interface TsCustomerStatisticDailyMapper extends BaseMapper<TsCustomerSta
49 49
 	 * @param nowDate
50 50
 	 * @param beforeDate
51 51
 	 * @param personId
52
+	 * @param userId
52 53
 	 * @return
53 54
 	 */
54
-	List<TsCustomerStatisticDaily> getDailyList(@Param("customerType") String customerType, @Param("orgId") Integer orgId, @Param("nowDate") LocalDateTime nowDate, @Param("beforeDate") LocalDateTime beforeDate,@Param("personId") String personId);
55
+	List<TsCustomerStatisticDaily> getDailyList(@Param("customerType") String customerType, @Param("orgId") Integer orgId, @Param("nowDate") LocalDateTime nowDate, @Param("beforeDate") LocalDateTime beforeDate, @Param("personId") String personId,@Param("userId") Integer userId);
55 56
 	
56 57
 	int deleteNowDate(@Param("nowDate") LocalDateTime nowDate,@Param("customerType") String customerType);
57 58
 }

+ 2
- 1
src/main/java/com/huiju/estateagents/statistic/mapper/TsCustomerStatisticMonthlyMapper.java Zobrazit soubor

@@ -49,7 +49,8 @@ public interface TsCustomerStatisticMonthlyMapper extends BaseMapper<TsCustomerS
49 49
 	 * @param nowDate
50 50
 	 * @param beforeDate
51 51
 	 * @param personId
52
+	 * @param userId
52 53
 	 * @return
53 54
 	 */
54
-	List<TsCustomerStatisticMonthly> getMonthlyList(@Param("customerType") String customerType, @Param("orgId") Integer orgId, @Param("nowDate") LocalDateTime nowDate, @Param("beforeDate") LocalDateTime beforeDate,@Param("personId") String personId);
55
+	List<TsCustomerStatisticMonthly> getMonthlyList(@Param("customerType") String customerType, @Param("orgId") Integer orgId, @Param("nowDate") LocalDateTime nowDate, @Param("beforeDate") LocalDateTime beforeDate, @Param("personId") String personId,@Param("userId") Integer userId);
55 56
 }

+ 2
- 1
src/main/java/com/huiju/estateagents/statistic/service/ITsCustomerStatisticDailyService.java Zobrazit soubor

@@ -39,7 +39,8 @@ public interface ITsCustomerStatisticDailyService extends IService<TsCustomerSta
39 39
 	 * @param customerType
40 40
 	 * @param orgId
41 41
 	 * @param personId
42
+	 * @param userId
42 43
 	 * @return
43 44
 	 */
44
-	List<TsCustomerStatisticDaily> getDailyList(String customerType, Integer orgId, String personId);
45
+	List<TsCustomerStatisticDaily> getDailyList(String customerType, Integer orgId, String personId, Integer userId);
45 46
 }

+ 2
- 1
src/main/java/com/huiju/estateagents/statistic/service/ITsCustomerStatisticMonthlyService.java Zobrazit soubor

@@ -39,7 +39,8 @@ public interface ITsCustomerStatisticMonthlyService extends IService<TsCustomerS
39 39
 	 * @param customerType
40 40
 	 * @param orgId
41 41
 	 * @param personId
42
+	 * @param userId
42 43
 	 * @return
43 44
 	 */
44
-	List<TsCustomerStatisticMonthly> getCustomerMonthlyList(String customerType, Integer orgId, String personId);
45
+	List<TsCustomerStatisticMonthly> getCustomerMonthlyList(String customerType, Integer orgId, String personId, Integer userId);
45 46
 }

+ 3
- 2
src/main/java/com/huiju/estateagents/statistic/service/impl/TsCustomerStatisticDailyServiceImpl.java Zobrazit soubor

@@ -78,17 +78,18 @@ public class TsCustomerStatisticDailyServiceImpl extends ServiceImpl<TsCustomerS
78 78
 	 * @param customerType
79 79
 	 * @param orgId
80 80
 	 * @param personId
81
+	 * @param userId
81 82
 	 * @return
82 83
 	 */
83 84
 	@Override
84
-	public List<TsCustomerStatisticDaily> getDailyList(String customerType, Integer orgId, String personId) {
85
+	public List<TsCustomerStatisticDaily> getDailyList(String customerType, Integer orgId, String personId, Integer userId) {
85 86
 		//当前日期
86 87
 		LocalDateTime nowDate = LocalDateTime.now();
87 88
 		//31天前的日期
88 89
 		LocalDateTime beforeDate = nowDate.plusDays(-31);
89 90
 		//获取31天的日期数据
90 91
 
91
-		List<TsCustomerStatisticDaily> list = customerStatisticDailyMapper.getDailyList(customerType,orgId,nowDate,beforeDate,personId);
92
+		List<TsCustomerStatisticDaily> list = customerStatisticDailyMapper.getDailyList(customerType,orgId,nowDate,beforeDate,personId,userId);
92 93
 		return list;
93 94
 	}
94 95
 	

+ 3
- 2
src/main/java/com/huiju/estateagents/statistic/service/impl/TsCustomerStatisticMonthlyServiceImpl.java Zobrazit soubor

@@ -77,16 +77,17 @@ public class TsCustomerStatisticMonthlyServiceImpl extends ServiceImpl<TsCustome
77 77
 	 * @param customerType
78 78
 	 * @param orgId
79 79
 	 * @param personId
80
+	 * @param userId
80 81
 	 * @return
81 82
 	 */
82 83
 	@Override
83
-	public List<TsCustomerStatisticMonthly> getCustomerMonthlyList(String customerType, Integer orgId, String personId) {
84
+	public List<TsCustomerStatisticMonthly> getCustomerMonthlyList(String customerType, Integer orgId, String personId, Integer userId) {
84 85
 		//当前日期
85 86
 		LocalDateTime nowDate = LocalDateTime.now();
86 87
 		//12个月前的日期
87 88
 		LocalDateTime beforeDate = nowDate.plusMonths(-12);
88 89
 		//获取31天的日期数据
89
-		List<TsCustomerStatisticMonthly> list = customerStatisticMonthlyMapper.getMonthlyList(customerType,orgId,nowDate,beforeDate,personId);
90
+		List<TsCustomerStatisticMonthly> list = customerStatisticMonthlyMapper.getMonthlyList(customerType,orgId,nowDate,beforeDate,personId,userId);
90 91
 		return list;
91 92
 	}
92 93
 	

+ 1
- 1
src/main/resources/mapper/TaRecommendCustomerMapper.xml Zobrazit soubor

@@ -607,7 +607,7 @@ FROM
607 607
 
608 608
     <select id="getMyCustStatistics" resultType="java.util.Map">
609 609
         SELECT
610
-            sum( IF ( STATUS = 4, 1, 0 ) ) AS clinchSum,
610
+            sum( IF ( STATUS = 4 AND verify_status = 1, 1, 0 ) ) AS clinchSum,
611 611
             sum( IF ( STATUS != 4 AND verify_status = 1, 1, 0 ) ) AS followSum
612 612
         FROM
613 613
             ta_recommend_customer

+ 2
- 1
src/main/resources/mapper/statistic/TsCustomerGenderStatisticMapper.xml Zobrazit soubor

@@ -14,7 +14,7 @@
14 14
         FROM
15 15
             ta_recommend_customer
16 16
         WHERE
17
-            date_format( create_date, '%Y-%m-%d' ) = date_format( #{nowDate}, '%Y-%m-%d' )
17
+            verify_status = 1
18 18
             GROUP BY org_id,realty_consultant
19 19
     </select>
20 20
     <select id="getFollowUpSexCount" resultType="com.huiju.estateagents.statistic.entity.GenderStatistic">
@@ -52,6 +52,7 @@
52 52
                     LEFT JOIN ta_recommend_customer c ON t.person_id = c.person_id
53 53
                     AND t.building_id = c.building_id
54 54
                     AND t.org_id = c.org_id
55
+                    AND c.verify_status = 1
55 56
                 WHERE
56 57
                     t.is_checkin = 1
57 58
                 GROUP BY

+ 3
- 1
src/main/resources/mapper/statistic/TsCustomerStatisticDailyMapper.xml Zobrazit soubor

@@ -30,6 +30,7 @@
30 30
             ta_recommend_customer
31 31
         WHERE
32 32
              date_format( create_date, '%Y-%m-%d' ) = date_format( #{nowDate}, '%Y-%m-%d' )
33
+             AND verify_status = 1
33 34
         GROUP BY
34 35
             org_id,realty_consultant
35 36
     </select>
@@ -43,6 +44,7 @@
43 44
             LEFT JOIN ta_recommend_customer c ON t.person_id = c.person_id
44 45
             AND t.building_id = c.building_id
45 46
             AND t.org_id = c.org_id
47
+            AND c.verify_status = 1
46 48
         WHERE
47 49
             t.is_checkin = #{checkin}
48 50
             AND date_format( t.create_date, '%Y-%m-%d' ) = date_format( #{nowDate}, '%Y-%m-%d' )
@@ -58,7 +60,7 @@
58 60
         WHERE
59 61
           org_id = #{orgId}
60 62
         AND customer_type = #{customerType}
61
-        AND realty_consultant = #{personId}
63
+        AND (realty_consultant = #{personId} or realty_consultant = #{userId})
62 64
         AND date_format( create_date, '%Y-%m-%d' ) >= date_format( #{beforeDate}, '%Y-%m-%d' )
63 65
         AND date_format( create_date, '%Y-%m-%d' ) &lt;= date_format( #{nowDate}, '%Y-%m-%d' )
64 66
         order by `day`

+ 3
- 1
src/main/resources/mapper/statistic/TsCustomerStatisticMonthlyMapper.xml Zobrazit soubor

@@ -12,6 +12,7 @@
12 12
             ta_recommend_customer
13 13
         WHERE
14 14
             date_format( create_date, '%Y-%m' ) = date_format( #{nowDate}, '%Y-%m' )
15
+            AND verify_status = 1
15 16
         GROUP BY
16 17
             org_id,realty_consultant
17 18
     </select>
@@ -40,6 +41,7 @@
40 41
             LEFT JOIN ta_recommend_customer c ON t.person_id = c.person_id
41 42
             AND t.building_id = c.building_id
42 43
             AND t.org_id = c.org_id
44
+            AND c.verify_status = 1
43 45
         WHERE
44 46
             t.is_checkin = #{checkin}
45 47
             AND date_format( t.create_date, '%Y-%m' ) = date_format( #{nowDate}, '%Y-%m' )
@@ -54,7 +56,7 @@
54 56
         WHERE
55 57
           org_id = #{orgId}
56 58
         AND customer_type = #{customerType}
57
-        AND realty_consultant = #{personId}
59
+        AND (realty_consultant = #{personId} or realty_consultant = #{userId})
58 60
         AND date_format( create_date, '%Y-%m-%d' ) >= date_format( #{beforeDate}, '%Y-%m-%d' )
59 61
         AND date_format( create_date, '%Y-%m-%d' ) &lt;= date_format( #{nowDate}, '%Y-%m-%d' )
60 62
          order by `month`