ab
2024-11-05 0c6faf64f2a02ae94b0d719729754f7ca29da416
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
package com.nova.sankuai.service.impl;
 
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nova.sankuai.domain.entity.CommunicationResults;
import com.nova.sankuai.infra.mapper.CommunicationResultsMapper;
import com.nova.sankuai.service.ICommunicationResultsService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
/**
 * @author weikangdi
 */
@Service
@AllArgsConstructor
public class CommunicationResultsServiceImpl extends ServiceImpl<CommunicationResultsMapper, CommunicationResults> implements ICommunicationResultsService {
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveResults(CommunicationResults results) {
        CommunicationResults resultsDb = lambdaQuery().eq(CommunicationResults::getCustomerId, results.getCustomerId()).one();
        if (resultsDb != null) {
            results.setId(resultsDb.getId());
        }
        saveOrUpdate(results);
    }
}