张延森 5 years ago
parent
commit
b30bbbe953

+ 15
- 5
src/main/java/com/huiju/estateagents/service/impl/TaPersonServiceImpl.java View File

@@ -113,9 +113,9 @@ public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> i
113 113
             return null;
114 114
         }
115 115
 
116
-        if (null == phone || "".equals(phone)) {
117
-            return null;
118
-        }
116
+//        if (null == phone || "".equals(phone)) {
117
+//            return null;
118
+//        }
119 119
 
120 120
         String tel = person.getTel();
121 121
 
@@ -124,7 +124,8 @@ public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> i
124 124
         wrapper.set("person_type",CommConstant.PERSON_ESTATE_AGENT);
125 125
 //        wrapper.set(null == tel || "".equals(tel), "tel", phone);
126 126
         wrapper.eq("mini_openid", miniOpenid);
127
-        wrapper.eq("person_type",null);
127
+//        wrapper.eq("person_type",null);
128
+        wrapper.isNull("person_type");
128 129
         taPersonMapper.update(new TaPerson(), wrapper);
129 130
 
130 131
         person.setPhone(phone);
@@ -307,13 +308,22 @@ public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> i
307 308
         result.put("avatar", taPerson.getAvatarurl());
308 309
         result.put("sex", taPerson.getSex());
309 310
         result.put("phone", taPerson.getTel());
310
-        result.put("integral", taPerson.getPoints());
311
+        result.put("points", taPerson.getPoints());
311 312
 
312 313
        // 查询最早的签到记录
313 314
         TaPersonSign taPersonSign = taPersonSignMapper.getLastSignRecord(taPerson.getPersonId());
314 315
         int havaSigned =  null == taPersonSign || !DateUtils.sameDay(LocalDateTime.now(), taPersonSign.getSignDate()) ? 0 : 1;
315 316
 
316 317
         result.put("havaSigned", havaSigned);
318
+
319
+        // 查詢我的客戶數量
320
+        Integer customerNum = taRecommendCustomerMapper.getMyCutsomerNum(taPerson.getPersonId());
321
+        result.put("customerNum", customerNum);
322
+
323
+        // 收藏數
324
+        // todo
325
+        result.put("saved", 0);
326
+
317 327
         return ResponseBean.success(result);
318 328
     }
319 329
 

+ 2
- 1
src/main/resources/mapper/TaRecommendCustomerMapper.xml View File

@@ -1,13 +1,14 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.huiju.estateagents.mapper.TaRecommendCustomerMapper">
4
-    <select id="getMyCutsomerNum" resultType="Integer">
4
+    <select id="getMyCutsomerNum" resultType="int">
5 5
         SELECT
6 6
             count(*) AS total
7 7
         FROM
8 8
             ta_recommend_customer t
9 9
         WHERE
10 10
             t.person_id = #{personId}
11
+            AND t.status &gt; -1
11 12
     </select>
12 13
     <select id="getCustomerPersonId" resultType="java.lang.String">
13 14
         SELECT