|
@@ -1,11 +1,16 @@
|
1
|
1
|
package com.huiju.estateagents.service.impl;
|
2
|
2
|
|
|
3
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
3
|
4
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
4
|
5
|
import com.huiju.estateagents.entity.TaPersonFromRecord;
|
|
6
|
+import com.huiju.estateagents.entity.TaPersonVisitRecord;
|
5
|
7
|
import com.huiju.estateagents.mapper.TaPersonFromRecordMapper;
|
6
|
8
|
import com.huiju.estateagents.service.ITaPersonFromRecordService;
|
|
9
|
+import org.springframework.beans.factory.annotation.Autowired;
|
7
|
10
|
import org.springframework.stereotype.Service;
|
8
|
11
|
|
|
12
|
+import java.time.LocalDateTime;
|
|
13
|
+
|
9
|
14
|
/**
|
10
|
15
|
* <p>
|
11
|
16
|
* 新增用户来源表 服务实现类
|
|
@@ -17,4 +22,35 @@ import org.springframework.stereotype.Service;
|
17
|
22
|
@Service
|
18
|
23
|
public class TaPersonFromRecordServiceImpl extends ServiceImpl<TaPersonFromRecordMapper, TaPersonFromRecord> implements ITaPersonFromRecordService {
|
19
|
24
|
|
|
25
|
+ @Autowired
|
|
26
|
+ private TaPersonFromRecordMapper taPersonFromRecordMapper;
|
|
27
|
+
|
|
28
|
+ /**
|
|
29
|
+ * 通過買點表清洗數據
|
|
30
|
+ * @param taPersonVisitRecord
|
|
31
|
+ */
|
|
32
|
+ @Override
|
|
33
|
+ public void addNewPersonRecordRecord(TaPersonVisitRecord taPersonVisitRecord) {
|
|
34
|
+ TaPersonFromRecord taPersonFromRecord = new TaPersonFromRecord();
|
|
35
|
+ taPersonFromRecord.setCreateDate(LocalDateTime.now());
|
|
36
|
+ taPersonFromRecord.setActivity(taPersonVisitRecord.getActivity());
|
|
37
|
+ taPersonFromRecord.setOrgId(Integer.valueOf(taPersonVisitRecord.getOrgId()));
|
|
38
|
+ taPersonFromRecord.setPersonId(taPersonVisitRecord.getPersonId());
|
|
39
|
+ taPersonFromRecord.setBuildingId(taPersonVisitRecord.getBuildingId());
|
|
40
|
+ taPersonFromRecord.setEvent(taPersonVisitRecord.getEvent());
|
|
41
|
+ taPersonFromRecord.setEventType(taPersonVisitRecord.getEventType());
|
|
42
|
+ taPersonFromRecord.setSceneId(taPersonVisitRecord.getSceneId());
|
|
43
|
+ taPersonFromRecord.setSharePersonId(taPersonVisitRecord.getSharePersonId());
|
|
44
|
+ taPersonFromRecord.setTargetId(taPersonVisitRecord.getTargetId());
|
|
45
|
+ QueryWrapper<TaPersonFromRecord> queryWrapper = new QueryWrapper<>();
|
|
46
|
+ queryWrapper.eq("org_id",taPersonVisitRecord.getOrgId());
|
|
47
|
+ queryWrapper.eq("person_id",taPersonVisitRecord.getPersonId());
|
|
48
|
+ int count = taPersonFromRecordMapper.selectCount(queryWrapper);
|
|
49
|
+ if(count > 0){
|
|
50
|
+ taPersonFromRecord.setIsFirstTime(false);
|
|
51
|
+ }else {
|
|
52
|
+ taPersonFromRecord.setIsFirstTime(true);
|
|
53
|
+ }
|
|
54
|
+ taPersonFromRecordMapper.insert(taPersonFromRecord);
|
|
55
|
+ }
|
20
|
56
|
}
|