buhuazhen
4 天以前 f028b02ddba8c5d6b00245640d0a382541efa820
refactor(service): 优化依赖注入方式

- 将 ContractInfoHandleService 中的 @RequiredArgsConstructor 替换为 @Autowired 注入 ContractInfoMapper
- 在 CustomerFollowUpFileServiceImpl 中移除 @RequiredArgsConstructor,改用 @Autowired 和 @Lazy 注入 CustomerFollowUpService
- 优化部分服务类的依赖注入声明,提高灵活性和可维护性
已修改2个文件
11 ■■■■ 文件已修改
src/main/java/com/ruoyi/basic/service/impl/CustomerFollowUpFileServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/projectManagement/service/impl/handle/ContractInfoHandleService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/basic/service/impl/CustomerFollowUpFileServiceImpl.java
@@ -11,6 +11,8 @@
import com.ruoyi.basic.service.CustomerFollowUpService;
import com.ruoyi.common.vo.SimpleFileVo;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.*;
@@ -31,7 +33,9 @@
@RequiredArgsConstructor
public class CustomerFollowUpFileServiceImpl extends ServiceImpl<CustomerFollowUpFileMapper, CustomerFollowUpFile> implements CustomerFollowUpFileService {
    private final CustomerFollowUpService customerFollowUpService;
    @Autowired
    @Lazy
    private CustomerFollowUpService customerFollowUpService;
    @Override
src/main/java/com/ruoyi/projectManagement/service/impl/handle/ContractInfoHandleService.java
@@ -5,6 +5,7 @@
import com.ruoyi.projectManagement.mapper.ContractInfoMapper;
import com.ruoyi.projectManagement.pojo.ContractInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -17,11 +18,11 @@
 * @email 3038525872@qq.com
 */
@Component
@RequiredArgsConstructor
@Transactional(rollbackFor = Exception.class,readOnly = true)
public class ContractInfoHandleService{
    private final ContractInfoMapper contractInfoMapper;
    @Autowired
    private ContractInfoMapper contractInfoMapper;
    @Transactional(rollbackFor = Exception.class)
    public void save(@Nullable Long id, @NotNull ContractInfoDto contractInfoDto) {