对比新文件 |
| | |
| | | package com.gk.firework.Service.ServiceImpl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gk.firework.Domain.ContractFile; |
| | | import com.gk.firework.Domain.Exception.BusinessException; |
| | | import com.gk.firework.Domain.Utils.StringUtils; |
| | | import com.gk.firework.Mapper.ContractFileMapper; |
| | | import com.gk.firework.Service.ContractFileService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("contractFileService") |
| | | public class ContractFileServiceImpl extends ServiceImpl<ContractFileMapper, ContractFile> implements ContractFileService { |
| | | |
| | | @Autowired |
| | | private ContractFileMapper contractFileMapper; |
| | | |
| | | @Override |
| | | public ContractFile selectByOrderCode(String ordercode) { |
| | | if (StringUtils.isBlank(ordercode)) { |
| | | throw new BusinessException("单号出现问题"); |
| | | } |
| | | LambdaQueryWrapper<ContractFile> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(ContractFile::getValidflag, true).eq(ContractFile::getOrdercode,ordercode); |
| | | return contractFileMapper.selectOne(queryWrapper) ; |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAll(String ordercode) { |
| | | if (StringUtils.isBlank(ordercode)) { |
| | | throw new BusinessException("单号出现问题"); |
| | | } |
| | | LambdaUpdateWrapper<ContractFile> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.set(ContractFile::getValidflag, false) |
| | | .eq(ContractFile::getOrdercode, ordercode); |
| | | this.update(updateWrapper); |
| | | } |
| | | } |