| | |
| | | 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.mapper.SpecificationsMapper; |
| | | import com.yuanchu.limslaboratory.pojo.LinkBasicInformation; |
| | | import com.yuanchu.limslaboratory.mapper.LinkBasicInformationMapper; |
| | | import com.yuanchu.limslaboratory.pojo.LinkDetection; |
| | | import com.yuanchu.limslaboratory.pojo.Specifications; |
| | | import com.yuanchu.limslaboratory.service.InspectionService; |
| | | 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.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Resource |
| | | private LinkBasicInformationMapper linkBasicInformationMapper; |
| | | |
| | | @Resource |
| | | private LinkDetectionMapper linkDetectionMapper; |
| | | |
| | | @Autowired |
| | | private LinkDetectionService linkDetectionService; |
| | | |
| | | @Autowired |
| | | private SpecificationsMapper specificationsMapperOn; |
| | | |
| | | @Resource |
| | | private InspectionService inspectionService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String addLinkBasicInformation(LinkBasicInformation linkBasicInformation) { |
| | | System.out.println(linkBasicInformation.getLinkDetectionList()); |
| | | QueryWrapper<LinkBasicInformation> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.lambda().select(LinkBasicInformation::getId).eq(LinkBasicInformation::getUid, linkBasicInformation.getUid()); |
| | | LinkBasicInformation linkBasicInformation1 = linkBasicInformationMapper.selectOne(queryWrapper); |
| | | Optional<Integer> optionalId = Optional.ofNullable(linkBasicInformation1) |
| | | .map(LinkBasicInformation::getId); |
| | | optionalId.ifPresent(l->{ |
| | | //执行删除 |
| | | linkDetectionMapper.deleteByLinkbasic(linkBasicInformation1.getId()); |
| | | linkBasicInformationMapper.deleteByID(linkBasicInformation1.getId()); |
| | | }); |
| | | //委托编号 |
| | | String code = MyUtil.getTimeSixNumberCode("SL", "SL"); |
| | | linkBasicInformation.setEntrustCoding(code); |
| | |
| | | linkDetectionService.updateById(linkDetection); |
| | | } |
| | | |
| | | @Override |
| | | public Specifications getSpecificationsName(String id) { |
| | | QueryWrapper<Specifications>queryWrapper=new QueryWrapper<>(); |
| | | queryWrapper.lambda().select(Specifications::getName) |
| | | .eq(Specifications::getId,id) |
| | | .eq(Specifications::getState,1); |
| | | return specificationsMapperOn.selectOne(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Object lookProByVer(String name, String mcode, String specifications,Integer version, Integer id) { |
| | | LinkDetection linkDetection = linkDetectionMapper.selectById(id); |
| | | return inspectionService.lookProByVer(name, mcode, specifications, version, linkDetection.getExperiment()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |