| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.mom.dto.BushingDto; |
| | | import com.yuanchu.mom.pojo.InsBushing; |
| | | import com.yuanchu.mom.mapper.InsBushingMapper; |
| | | import com.yuanchu.mom.service.InsBushingService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-05-30 05:58:16 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class InsBushingServiceImpl extends ServiceImpl<InsBushingMapper, InsBushing> implements InsBushingService { |
| | | |
| | | private InsBushingMapper insBushingMapper; |
| | | |
| | | @Override |
| | | public List<BushingDto> selectBushingBySampleId(Integer sampleId) { |
| | | List<InsBushing> insBushings = insBushingMapper.selectList(Wrappers.<InsBushing>lambdaQuery().eq(InsBushing::getInsSampleId, sampleId)); |
| | | List<BushingDto> bushingDtos = new ArrayList<>(); |
| | | for (InsBushing insBushing : insBushings) { |
| | | BushingDto bushingDto = JSON.parseObject(JSON.toJSONString(insBushing), BushingDto.class); |
| | | bushingDto.setFiber(insBushingMapper.selectFiberByBushingId(bushingDto.getId())); |
| | | bushingDtos.add(bushingDto); |
| | | } |
| | | return bushingDtos; |
| | | } |
| | | } |