Browse Source

change Customer

胡轶钦 5 years ago
parent
commit
acbdb3a0aa

+ 15
- 0
src/main/java/com/huiju/estateagents/common/CommConstant.java View File

@@ -154,4 +154,19 @@ public class CommConstant {
154 154
 
155 155
     //=================  首屏广告 / 轮播图 end =======================
156 156
 
157
+    //=================  客户入口类型 start =======================
158
+    /*
159
+    * 自主进入
160
+    * */
161
+    public static final String ENTRY_VOLUNTEER = "volunteer";
162
+    /*
163
+    添加
164
+    */
165
+    public static final String ENTRY_INPUT = "input";
166
+    /*
167
+    * 报备
168
+    * */
169
+    public static final String ENTRY_VERIFY = "verify";
170
+    //=================  客户入口类型 end =======================
171
+
157 172
 }

+ 27
- 0
src/main/java/com/huiju/estateagents/controller/TaPointsRecordsController.java View File

@@ -126,6 +126,7 @@ public class TaPointsRecordsController extends BaseController {
126 126
     public ResponseBean taPointsRecordsUpdate(@PathVariable Integer id,
127 127
                                         @RequestBody TaPointsRecords taPointsRecords){
128 128
         ResponseBean responseBean = new ResponseBean();
129
+        taPointsRecords.setPointsRecordId(id);
129 130
         try {
130 131
             if (iTaPointsRecordsService.updateById(taPointsRecords)){
131 132
                 responseBean.addSuccess(taPointsRecords);
@@ -185,4 +186,30 @@ public class TaPointsRecordsController extends BaseController {
185 186
         }
186 187
         return responseBean;
187 188
     }
189
+
190
+    /**
191
+     * 分页查询列表
192
+     * @param pageNum
193
+     * @param pageSize
194
+     * @return
195
+     */
196
+    @RequestMapping(value="/admin/taPointsRecords/{id}",method= RequestMethod.GET)
197
+    public ResponseBean CustomerPointsRecordsList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
198
+                                            @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
199
+                                            String id){
200
+        ResponseBean responseBean = new ResponseBean();
201
+        try {
202
+            IPage<TaPointsRecords> pg = new Page<>(pageNum, pageSize);
203
+            QueryWrapper<TaPointsRecords> queryWrapper = new QueryWrapper<>();
204
+            queryWrapper.eq("person_id",taPersonService.getPersonIdByCustomerId(id));
205
+            queryWrapper.orderByDesc("create_date");
206
+            IPage<TaPointsRecords> result = iTaPointsRecordsService.page(pg, queryWrapper);
207
+            responseBean.addSuccess(result);
208
+        }catch (Exception e){
209
+            e.printStackTrace();
210
+            logger.error("taPointsRecordsList -=- {}",e.toString());
211
+            responseBean.addError(e.getMessage());
212
+        }
213
+        return responseBean;
214
+    }
188 215
 }

+ 4
- 2
src/main/java/com/huiju/estateagents/controller/TaRecommendCustomerController.java View File

@@ -112,9 +112,11 @@ public class TaRecommendCustomerController extends BaseController {
112 112
                                          @RequestParam(value ="consultName",required = false) String consultName,
113 113
                                          @RequestParam(value ="consultTel",required = false) String consultTel,
114 114
                                          @RequestParam(value ="pageNumber",defaultValue = "1") Integer pageNumber,
115
-                                         @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
115
+                                         @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
116
+                                         @RequestParam(value ="entryType",required = false) String entryType,
117
+                                         @RequestParam(value ="verifyStatus",required = false) String verifyStatus){
116 118
         try{
117
-            return ResponseBean.success(taRecommendCustomerService.getCustomerList(pageNumber,pageSize,buildingId,name,tel,consultName,consultTel));
119
+            return ResponseBean.success(taRecommendCustomerService.getCustomerList(pageNumber,pageSize,buildingId,name,tel,consultName,consultTel,entryType,verifyStatus));
118 120
         }catch (Exception e){
119 121
             e.printStackTrace();
120 122
             return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);

+ 4
- 0
src/main/java/com/huiju/estateagents/entity/TaPointsRecords.java View File

@@ -1,6 +1,7 @@
1 1
 package com.huiju.estateagents.entity;
2 2
 
3 3
 import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
4 5
 import com.baomidou.mybatisplus.annotation.TableId;
5 6
 import lombok.Data;
6 7
 import lombok.EqualsAndHashCode;
@@ -80,5 +81,8 @@ public class TaPointsRecords implements Serializable {
80 81
      */
81 82
     private Integer status;
82 83
 
84
+    @TableField(exist = false)
85
+    private Integer totalPoints;
86
+
83 87
 
84 88
 }

+ 2
- 0
src/main/java/com/huiju/estateagents/entity/TaRecommendCustomer.java View File

@@ -139,6 +139,8 @@ public class TaRecommendCustomer implements Serializable {
139 139
 
140 140
     private String city;
141 141
 
142
+    private String entryType;
143
+
142 144
     @TableField(exist = false)
143 145
     private List<TaPersonVisitRecord> visitRecords;
144 146
 

+ 3
- 0
src/main/java/com/huiju/estateagents/mapper/TaPointsRecordsMapper.java View File

@@ -1,8 +1,10 @@
1 1
 package com.huiju.estateagents.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4 5
 import com.huiju.estateagents.entity.TaPointsRecords;
5 6
 import org.apache.ibatis.annotations.Mapper;
7
+import org.apache.ibatis.annotations.Param;
6 8
 
7 9
 /**
8 10
  * <p>
@@ -14,5 +16,6 @@ import org.apache.ibatis.annotations.Mapper;
14 16
  */
15 17
 @Mapper
16 18
 public interface TaPointsRecordsMapper extends BaseMapper<TaPointsRecords> {
19
+    IPage<TaPointsRecords> getCustomerPointsList(IPage<TaPointsRecords> page, @Param("personId") String personId);
17 20
 
18 21
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaRecommendCustomerMapper.java View File

@@ -25,7 +25,7 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
25 25
 
26 26
     TaRecommendCustomer getCustomerById(@Param("customerId")String customerId);
27 27
 
28
-    IPage<TaRecommendCustomer> getCustomerList(IPage<TaRecommendCustomer> page,@Param("building") String building, @Param("name") String name, @Param("tel") String tel, @Param("consultName") String consultName, @Param("consultTel") String consultTel);
28
+    IPage<TaRecommendCustomer> getCustomerList(IPage<TaRecommendCustomer> page,@Param("building") String building, @Param("name") String name, @Param("tel") String tel, @Param("consultName") String consultName, @Param("consultTel") String consultTel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus);
29 29
 
30 30
 
31 31
 }

+ 2
- 0
src/main/java/com/huiju/estateagents/service/ITaPersonService.java View File

@@ -54,5 +54,7 @@ public interface ITaPersonService extends IService<TaPerson> {
54 54
 
55 55
     IPage<TaPerson> getDriftCustomerList (int pageNumber, int pageSize,String building);
56 56
 
57
+    String getPersonIdByCustomerId(String customerId);
58
+
57 59
 
58 60
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/service/ITaRecommendCustomerService.java View File

@@ -25,7 +25,7 @@ public interface ITaRecommendCustomerService extends IService<TaRecommendCustome
25 25
 
26 26
     IPage<TaRecommendCustomer> getUnSignedCustomerList(int pageNumber, int pageSize, String building,String personId);
27 27
 
28
-    IPage<TaRecommendCustomer> getCustomerList(int pageNumber, int pageSize, String building,String name,String tel,String consultName,String consultTel);
28
+    IPage<TaRecommendCustomer> getCustomerList(int pageNumber, int pageSize, String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus);
29 29
 
30 30
     TaRecommendCustomer getCustomerDetail(String customerId);
31 31
 

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

@@ -634,4 +634,9 @@ public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> i
634 634
         IPage<TaPerson> page = new Page<>(pageNumber, pageSize);
635 635
         return taPersonMapper.selectPage(page,queryWrapper);
636 636
     }
637
+
638
+    @Override
639
+    public String getPersonIdByCustomerId(String customerId){
640
+        return taRecommendCustomerMapper.getCustomerPersonId(customerId);
641
+    }
637 642
 }

+ 2
- 2
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java View File

@@ -246,9 +246,9 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
246 246
     }
247 247
 
248 248
     @Override
249
-    public IPage<TaRecommendCustomer> getCustomerList(int pageNumber, int pageSize,String building,String name,String tel,String consultName,String consultTel){
249
+    public IPage<TaRecommendCustomer> getCustomerList(int pageNumber, int pageSize,String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus){
250 250
         IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
251
-        return taRecommendCustomerMapper.getCustomerList(page,building,name,tel,consultName,consultTel);
251
+        return taRecommendCustomerMapper.getCustomerList(page,building,name,tel,consultName,consultTel,entryType,verifyStatus);
252 252
     }
253 253
 
254 254
     @Override

+ 7
- 0
src/main/resources/mapper/TaRecommendCustomerMapper.xml View File

@@ -56,6 +56,13 @@ FROM
56 56
         <if test="consultTel != null and consultTel !=''">
57 57
             and b.tel = #{consultTel}
58 58
         </if>
59
+        <if test="entryType != null and entryType !=''">
60
+            and a.entry_type = #{entryType}
61
+        </if>
62
+        <if test="verifyStatus != null and verifyStatus !=''">
63
+            and a.verify_status = #{verifyStatus}
64
+        </if>
65
+
59 66
     </where>
60 67
     </select>
61 68
     <select id="getCustomerById" resultType="com.huiju.estateagents.entity.TaRecommendCustomer">