| | |
| | | package me.zhengjie.modules.contract.service.impl; |
| | | |
| | | import me.zhengjie.modules.contract.domain.Contract; |
| | | import me.zhengjie.modules.contract.domain.ContractFirst; |
| | | import me.zhengjie.modules.contract.domain.ContractMail; |
| | | import me.zhengjie.modules.contract.domain.ContractSecond; |
| | | import me.zhengjie.modules.contract.repository.ContractFirstRepository; |
| | | import me.zhengjie.modules.contract.repository.ContractRepository; |
| | | import me.zhengjie.modules.contract.repository.ContractSecondRepository; |
| | | import me.zhengjie.utils.ValidationUtil; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | |
| | | private final ContractMailRepository contractMailRepository; |
| | | private final ContractRepository contractRepository; |
| | | private final ContractFirstRepository contractFirstRepository; |
| | | private final ContractSecondRepository contractSecondRepository; |
| | | private final ContractMailMapper contractMailMapper; |
| | | |
| | | @Override |
| | |
| | | ContractMailDto contractMailDto = contractMailMapper.toDto(t); |
| | | // 查询合同数据 |
| | | Contract contract = contractRepository.findById(t.getContractId()).orElseGet(Contract::new); |
| | | // 查询合同数据 |
| | | ContractFirst contractFirst = contractFirstRepository.findById(t.getFirstId()).orElseGet(ContractFirst::new); |
| | | // 查询合同数据 |
| | | ContractSecond contractSecond = contractSecondRepository.findById(t.getSecondId()).orElseGet(ContractSecond::new); |
| | | |
| | | // DTO赋值 |
| | | contractMailDto.setContractName(contract.getContractName()); |
| | | contractMailDto.setFirstName(contractFirst.getFirstName()); |
| | | contractMailDto.setSecondName(contractSecond.getSecondName()); |
| | | // 返回处理好的DTO |
| | | return contractMailDto; |
| | | } |