FollowRecordServiceImpl.java
1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package cn.fw.valhalla.service.data.impl;
import cn.fw.valhalla.dao.mapper.FollowRecordMapper;
import cn.fw.valhalla.domain.db.follow.FollowRecord;
import cn.fw.valhalla.domain.enums.FollowTypeEnum;
import cn.fw.valhalla.service.data.FollowRecordService;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author : kurisu
* @className : FollowRecordImpl
* @description : 跟进记录
* @date: 2020-08-12 11:10
*/
@Slf4j
@Service
public class FollowRecordServiceImpl extends ServiceImpl<FollowRecordMapper, FollowRecord> implements FollowRecordService {
@Override
@Transactional(rollbackFor = Exception.class)
public boolean overdue(final Long id) {
return this.update(Wrappers.<FollowRecord>lambdaUpdate()
.set(FollowRecord::getOutTime, Boolean.TRUE)
.eq(FollowRecord::getId, id)
);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void removeRecordByCustId(Long customerId, List<FollowTypeEnum> list) {
remove(Wrappers.<FollowRecord>lambdaQuery()
.eq(FollowRecord::getCustomerId, customerId)
.eq(FollowRecord::getOutTime, Boolean.FALSE)
.eq(FollowRecord::getAddTodo, Boolean.FALSE)
.in(!CollectionUtils.isEmpty(list), FollowRecord::getType, list)
);
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean updateById(final FollowRecord entity) {
return super.updateById(entity);
}
}