|
@@ -1,14 +1,18 @@
|
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.base.ResponseBean;
|
5
|
6
|
import com.huiju.estateagents.entity.TaBuildingIntention;
|
6
|
7
|
import com.huiju.estateagents.entity.TdBizEvent;
|
7
|
8
|
import com.huiju.estateagents.mapper.TaBuildingIntentionMapper;
|
|
9
|
+import com.huiju.estateagents.mapper.TdBizEventMapper;
|
8
|
10
|
import com.huiju.estateagents.service.ITaBuildingIntentionService;
|
9
|
11
|
import org.springframework.beans.factory.annotation.Autowired;
|
10
|
12
|
import org.springframework.stereotype.Service;
|
11
|
13
|
|
|
14
|
+import java.time.LocalDateTime;
|
|
15
|
+import java.util.ArrayList;
|
12
|
16
|
import java.util.List;
|
13
|
17
|
import java.util.stream.Collectors;
|
14
|
18
|
|
|
@@ -26,6 +30,9 @@ public class TaBuildingIntentionServiceImpl extends ServiceImpl<TaBuildingIntent
|
26
|
30
|
@Autowired
|
27
|
31
|
private TaBuildingIntentionMapper taBuildingIntentionMapper;
|
28
|
32
|
|
|
33
|
+ @Autowired
|
|
34
|
+ private TdBizEventMapper tdBizEventMapper;
|
|
35
|
+
|
29
|
36
|
@Override
|
30
|
37
|
public ResponseBean taBuildingIntentionAddOrUpdate(List<TdBizEvent>tdBizEventsList, String buildingId, Integer orgId) {
|
31
|
38
|
ResponseBean responseBean = new ResponseBean();
|
|
@@ -53,4 +60,32 @@ public class TaBuildingIntentionServiceImpl extends ServiceImpl<TaBuildingIntent
|
53
|
60
|
responseBean.addSuccess("操作成功!");
|
54
|
61
|
return responseBean;
|
55
|
62
|
}
|
|
63
|
+
|
|
64
|
+ /**
|
|
65
|
+ * 保存楼盘默认值
|
|
66
|
+ *
|
|
67
|
+ * @param orgId
|
|
68
|
+ * @param buildingId
|
|
69
|
+ */
|
|
70
|
+ @Override
|
|
71
|
+ public void saveDefaultIntention(Integer orgId, String buildingId) {
|
|
72
|
+ //获取所有的意向值类型
|
|
73
|
+ List<TdBizEvent> tdBizEventList = tdBizEventMapper.selectList(new QueryWrapper<>());
|
|
74
|
+ //构造意向值
|
|
75
|
+ List<TaBuildingIntention> taBuildingIntentions = new ArrayList<>();
|
|
76
|
+ tdBizEventList.forEach(e -> {
|
|
77
|
+ TaBuildingIntention taBuildingIntention = new TaBuildingIntention();
|
|
78
|
+ taBuildingIntention.setIntentionId(e.getIntentionId());
|
|
79
|
+ taBuildingIntention.setEventId(e.getEventId());
|
|
80
|
+ taBuildingIntention.setEventCode(e.getEventCode());
|
|
81
|
+ taBuildingIntention.setEventName(e.getEventName());
|
|
82
|
+ taBuildingIntention.setIntention(1);
|
|
83
|
+ taBuildingIntention.setCreateDate(LocalDateTime.now());
|
|
84
|
+ taBuildingIntention.setBuildingId(buildingId);
|
|
85
|
+ taBuildingIntention.setStatus(1);
|
|
86
|
+ taBuildingIntention.setOrgId(orgId);
|
|
87
|
+ taBuildingIntentions.add(taBuildingIntention);
|
|
88
|
+ });
|
|
89
|
+ this.saveBatch(taBuildingIntentions);
|
|
90
|
+ }
|
56
|
91
|
}
|