| 对比新文件 |
| | |
| | | package com.ruoyi.projectManagement.service.impl.handle; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.ruoyi.projectManagement.dto.ContractInfoDto; |
| | | 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; |
| | | |
| | | import javax.annotation.Nullable; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Component |
| | | @Transactional(rollbackFor = Exception.class,readOnly = true) |
| | | public class ContractInfoHandleService{ |
| | | |
| | | @Autowired |
| | | private ContractInfoMapper contractInfoMapper; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void save(@Nullable Long id, @NotNull ContractInfoDto contractInfoDto) { |
| | | ContractInfo contractInfo = BeanUtil.copyProperties(contractInfoDto, ContractInfo.class); |
| | | contractInfo.setProjectManagementInfoId(id); |
| | | if (contractInfoDto.getId() == null) { |
| | | contractInfoMapper.insert(contractInfo); |
| | | } else { |
| | | contractInfoMapper.updateById(contractInfo); |
| | | } |
| | | } |
| | | } |