| | |
| | | package com.ruoyi.projectManagement.service.impl.handle; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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; |
| | | |
| | |
| | | * @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) { |
| | |
| | | contractInfoMapper.updateById(contractInfo); |
| | | } |
| | | } |
| | | |
| | | public ContractInfoDto getByInfoId(@NotNull Long id) { |
| | | LambdaQueryWrapper<ContractInfo> queryWrapper = new LambdaQueryWrapper<ContractInfo>(); |
| | | queryWrapper.eq(ContractInfo::getProjectManagementInfoId, id); |
| | | queryWrapper.eq(ContractInfo::getIsDelete, 0); |
| | | queryWrapper.last("limit 1"); |
| | | ContractInfo contractInfo = contractInfoMapper.selectOne(queryWrapper); |
| | | return BeanUtil.copyProperties(contractInfo, ContractInfoDto.class); |
| | | } |
| | | |
| | | } |