胡轶钦 5 年前
父节点
当前提交
bdf03c2308

+ 14
- 0
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java 查看文件

186
         taRecommendCustomer.setCreateDate(LocalDateTime.now());
186
         taRecommendCustomer.setCreateDate(LocalDateTime.now());
187
         taRecommendCustomer.setReportDate(LocalDateTime.now());
187
         taRecommendCustomer.setReportDate(LocalDateTime.now());
188
         taRecommendCustomer.setOrgId(orgId);
188
         taRecommendCustomer.setOrgId(orgId);
189
+       QueryWrapper<TaPerson> personQueryWrapper = new QueryWrapper<>();
190
+       personQueryWrapper.eq("org_id",orgId);
191
+       personQueryWrapper.eq("phone",params.getString("phone"));
192
+        TaPerson currentPerson = taPersonMapper.selectOne(personQueryWrapper);
193
+        if(null != currentPerson){
194
+            taRecommendCustomer.setPersonId(currentPerson.getPersonId());
195
+        }
189
 
196
 
190
         // 时间格式 yyyy-MM-dd
197
         // 时间格式 yyyy-MM-dd
191
         String at = params.getString("appointmentTime");
198
         String at = params.getString("appointmentTime");
289
         taRecommendCustomer.setEntryType(CommConstant.ENTRY_VERIFY);
296
         taRecommendCustomer.setEntryType(CommConstant.ENTRY_VERIFY);
290
         taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
297
         taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
291
         taRecommendCustomer.setStatus(CommConstant.CUSTOMER_REPORT);
298
         taRecommendCustomer.setStatus(CommConstant.CUSTOMER_REPORT);
299
+        QueryWrapper<TaPerson> personQueryWrapper = new QueryWrapper<>();
300
+        personQueryWrapper.eq("org_id",orgId);
301
+        personQueryWrapper.eq("phone",params.getString("phone"));
302
+        TaPerson currentPerson = taPersonMapper.selectOne(personQueryWrapper);
303
+        if(null != currentPerson){
304
+            taRecommendCustomer.setPersonId(currentPerson.getPersonId());
305
+        }
292
 
306
 
293
 
307
 
294
 //        String status = params.getString("status");
308
 //        String status = params.getString("status");

+ 1
- 1
src/main/resources/mapper/TaRecommendCustomerMapper.xml 查看文件

22
     <select id="getCustomerDetail" resultType="com.huiju.estateagents.entity.TaRecommendCustomer">
22
     <select id="getCustomerDetail" resultType="com.huiju.estateagents.entity.TaRecommendCustomer">
23
       SELECT
23
       SELECT
24
 	a.*,
24
 	a.*,
25
-	(select c.visit_time FROM ta_person_visit_record c where c.person_id = #{personId} ORDER BY c.visit_time desc LIMIT 1) as visitTime,
25
+	(select c.visit_time FROM ta_person_visit_record c where c.person_id = #{personId} ORDER BY c.visit_time asc LIMIT 1) as visitTime,
26
 	(SELECT SUM(d.visit_duration) FROM ta_person_visit_record d WHERE d.person_id= #{personId}) as duration
26
 	(SELECT SUM(d.visit_duration) FROM ta_person_visit_record d WHERE d.person_id= #{personId}) as duration
27
 FROM
27
 FROM
28
 	ta_recommend_customer a
28
 	ta_recommend_customer a