| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.mapper.LinkDetectionMapper; |
| | | import com.yuanchu.limslaboratory.pojo.LinkBasicInformation; |
| | | import com.yuanchu.limslaboratory.mapper.LinkBasicInformationMapper; |
| | | import com.yuanchu.limslaboratory.pojo.LinkDetection; |
| | | import com.yuanchu.limslaboratory.service.LinkBasicInformationService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.service.LinkDetectionService; |
| | |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | |
| | | @Resource |
| | | private LinkBasicInformationMapper linkBasicInformationMapper; |
| | | |
| | | @Resource |
| | | private LinkDetectionMapper linkDetectionMapper; |
| | | |
| | | @Autowired |
| | | private LinkDetectionService linkDetectionService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String addLinkBasicInformation(LinkBasicInformation linkBasicInformation) { |
| | | QueryWrapper<LinkBasicInformation> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.lambda().select(LinkBasicInformation::getId).eq(LinkBasicInformation::getUid, linkBasicInformation.getUid()); |
| | | LinkBasicInformation linkBasicInformation1 = linkBasicInformationMapper.selectOne(queryWrapper); |
| | | Optional.ofNullable(linkBasicInformation.getId()).ifPresent(l->{ |
| | | //执行删除 |
| | | linkDetectionMapper.deleteByLinkbasic(linkBasicInformation1.getId()); |
| | | linkBasicInformationMapper.deleteById(linkBasicInformation1.getId()); |
| | | }); |
| | | //委托编号 |
| | | String code = MyUtil.getTimeSixNumberCode("SL", "SL"); |
| | | linkBasicInformation.setEntrustCoding(code); |
| | |
| | | return linkBasicInformationMapper.getLinkBasicInformation(viewId); |
| | | } |
| | | |
| | | //根据委托样品删除 |
| | | @Override |
| | | public void delLink(Integer id) { |
| | | LinkDetection linkDetection = new LinkDetection(); |
| | | linkDetection.setId(id); |
| | | linkDetection.setState(0); |
| | | linkDetectionService.updateById(linkDetection); |
| | | } |
| | | |
| | | |
| | | } |