胡轶钦 5 yıl önce
ebeveyn
işleme
bdf03c2308

+ 14
- 0
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java Dosyayı Görüntüle

@@ -186,6 +186,13 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
186 186
         taRecommendCustomer.setCreateDate(LocalDateTime.now());
187 187
         taRecommendCustomer.setReportDate(LocalDateTime.now());
188 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 197
         // 时间格式 yyyy-MM-dd
191 198
         String at = params.getString("appointmentTime");
@@ -289,6 +296,13 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
289 296
         taRecommendCustomer.setEntryType(CommConstant.ENTRY_VERIFY);
290 297
         taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
291 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 308
 //        String status = params.getString("status");

+ 1
- 1
src/main/resources/mapper/TaRecommendCustomerMapper.xml Dosyayı Görüntüle

@@ -22,7 +22,7 @@ WHERE
22 22
     <select id="getCustomerDetail" resultType="com.huiju.estateagents.entity.TaRecommendCustomer">
23 23
       SELECT
24 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 26
 	(SELECT SUM(d.visit_duration) FROM ta_person_visit_record d WHERE d.person_id= #{personId}) as duration
27 27
 FROM
28 28
 	ta_recommend_customer a