|
@@ -4,12 +4,18 @@ package com.huiju.estateagents.sample.service.impl;
|
4
|
4
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
5
|
5
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
6
|
6
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
7
|
+import com.huiju.estateagents.base.ResponseBean;
|
|
8
|
+import com.huiju.estateagents.common.CommConstant;
|
7
|
9
|
import com.huiju.estateagents.sample.entity.TaContact;
|
8
|
10
|
import com.huiju.estateagents.sample.mapper.TaContactMapper;
|
|
11
|
+import com.huiju.estateagents.sample.mapper.TaH5SampleMapper;
|
9
|
12
|
import com.huiju.estateagents.sample.service.ITaContactService;
|
10
|
13
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
14
|
import org.springframework.stereotype.Service;
|
12
|
15
|
|
|
16
|
+import java.util.ArrayList;
|
|
17
|
+import java.util.List;
|
|
18
|
+
|
13
|
19
|
/**
|
14
|
20
|
* <p>
|
15
|
21
|
* 联系人表 服务实现类
|
|
@@ -22,11 +28,34 @@ import org.springframework.stereotype.Service;
|
22
|
28
|
public class TaContactServiceImpl extends ServiceImpl<TaContactMapper, TaContact> implements ITaContactService {
|
23
|
29
|
|
24
|
30
|
@Autowired
|
25
|
|
- TaContactMapper taContactMapper;
|
|
31
|
+ private TaContactMapper taContactMapper;
|
|
32
|
+
|
|
33
|
+ @Autowired
|
|
34
|
+ private TaH5SampleMapper taH5SampleMapper;
|
26
|
35
|
|
27
|
36
|
@Override
|
28
|
37
|
public IPage<TaContact> taContactInfoBySampleId(String id, Integer pageNum, Integer pageSize) {
|
29
|
38
|
IPage<TaContact> pg = new Page<>(pageNum, pageSize);
|
30
|
|
- return taContactMapper.taContactInfoBySampleId(pg, id);
|
|
39
|
+ return taContactMapper.taContactInfoBySampleId(pg, id);
|
|
40
|
+ }
|
|
41
|
+
|
|
42
|
+ @Override
|
|
43
|
+ public ResponseBean batchDelete(List<TaContact> taContactList, Integer userId) {
|
|
44
|
+ ResponseBean responseBean = new ResponseBean();
|
|
45
|
+
|
|
46
|
+ List<TaContact> updateList = new ArrayList<>();
|
|
47
|
+ TaContact newContact;
|
|
48
|
+ for (TaContact taContact : taContactList) {
|
|
49
|
+ newContact = new TaContact();
|
|
50
|
+ newContact.setContactId(taContact.getContactId());
|
|
51
|
+ newContact.setStatus(CommConstant.STATUS_DELETE);
|
|
52
|
+ updateList.add(newContact);
|
|
53
|
+ }
|
|
54
|
+
|
|
55
|
+ // 更新样例表状态
|
|
56
|
+ taH5SampleMapper.batchUpdateStatus(updateList, userId);
|
|
57
|
+
|
|
58
|
+ responseBean.addSuccess(updateBatchById(updateList));
|
|
59
|
+ return responseBean;
|
31
|
60
|
}
|
32
|
61
|
}
|