|
@@ -6,6 +6,7 @@ import com.huiju.estateagents.entity.TaBuildingIntention;
|
6
|
6
|
import com.huiju.estateagents.entity.TdBizEvent;
|
7
|
7
|
import com.huiju.estateagents.mapper.TaBuildingIntentionMapper;
|
8
|
8
|
import com.huiju.estateagents.service.ITaBuildingIntentionService;
|
|
9
|
+import org.springframework.beans.factory.annotation.Autowired;
|
9
|
10
|
import org.springframework.stereotype.Service;
|
10
|
11
|
|
11
|
12
|
import java.util.List;
|
|
@@ -22,11 +23,17 @@ import java.util.stream.Collectors;
|
22
|
23
|
@Service
|
23
|
24
|
public class TaBuildingIntentionServiceImpl extends ServiceImpl<TaBuildingIntentionMapper, TaBuildingIntention> implements ITaBuildingIntentionService {
|
24
|
25
|
|
|
26
|
+ @Autowired
|
|
27
|
+ private TaBuildingIntentionMapper taBuildingIntentionMapper;
|
25
|
28
|
|
26
|
29
|
@Override
|
27
|
30
|
public ResponseBean taBuildingIntentionAddOrUpdate(List<TdBizEvent>tdBizEventsList, String buildingId) {
|
28
|
31
|
ResponseBean responseBean = new ResponseBean();
|
29
|
32
|
|
|
33
|
+ // 先删除库中存在的
|
|
34
|
+ taBuildingIntentionMapper.deleteByBuildingId(buildingId);
|
|
35
|
+
|
|
36
|
+
|
30
|
37
|
// 获取所有需要 保存 或者 修改
|
31
|
38
|
List<TaBuildingIntention> taBuildingIntentions = tdBizEventsList.stream().filter(e -> e.getCheckbox()).map(e -> {
|
32
|
39
|
TaBuildingIntention taBuildingIntention = new TaBuildingIntention();
|