cloudroam
2025-01-07 12b95a4ef0392330f275f0a9fa9da42bb39bb5bd
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
53
54
55
56
57
58
59
60
package com.mzl.flower.service.config.impl;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mzl.flower.config.security.SecurityUtils;
import com.mzl.flower.dto.request.configParam.ConfigCustomerServiceDTO;
import com.mzl.flower.dto.request.configParam.ConfigCustomerServiceQueryDTO;
import com.mzl.flower.dto.response.configParam.ConfigCustomerServiceVO;
import com.mzl.flower.entity.configParam.ConfigCustomerService;
import com.mzl.flower.mapper.configParam.ConfigCustomerServiceMapper;
import com.mzl.flower.service.config.ConfigCustomerServiceService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
import java.util.List;
 
/**
 * @author fanghaowei
 * @version version2.0
 * @className ConfigCustomerServiceServiceImpl
 * @date 2024/8/26
 * @description 配置客户管理功能逻辑层
 */
@Service
@Transactional
@RequiredArgsConstructor
public class ConfigCustomerServiceServiceImpl extends ServiceImpl<ConfigCustomerServiceMapper, ConfigCustomerService> implements ConfigCustomerServiceService {
 
    private final ConfigCustomerServiceMapper configCustomerServiceMapper;
 
    @Override
    public void saveConfigCustomerService(ConfigCustomerServiceDTO configCustomerServiceDTO) {
        ConfigCustomerService configCustomerService = new ConfigCustomerService();
        BeanUtils.copyProperties(configCustomerServiceDTO, configCustomerService);
        configCustomerService.create(SecurityUtils.getUserId());
        configCustomerServiceMapper.insert(configCustomerService);
    }
 
    @Override
    public void updateConfigCustomerService(ConfigCustomerServiceDTO configCustomerServiceDTO) {
        ConfigCustomerService configCustomerServiceInfo = configCustomerServiceMapper.selectById(configCustomerServiceDTO.getId());
        BeanUtils.copyProperties(configCustomerServiceDTO, configCustomerServiceInfo);
        configCustomerServiceInfo.update(SecurityUtils.getUserId());
        configCustomerServiceMapper.updateById(configCustomerServiceInfo);
    }
 
    @Override
    public void deleteConfigCustomerService(String id) {
        configCustomerServiceMapper.deleteById(id);
    }
 
    @Override
    public Page<ConfigCustomerServiceVO> queryPage(ConfigCustomerServiceQueryDTO configCustomerServiceQueryDTO, Page page) {
        List<ConfigCustomerServiceVO> list = configCustomerServiceMapper.queryPage(configCustomerServiceQueryDTO, page);
        page.setRecords(list);
        return page;
    }
}