| | |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.basic.service.StandardProductListService; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Override |
| | | public List<StandardProductList> selectStandardProductList(InsSample1 insSample) { |
| | | String[] models = insSample.getModel().split("-(?=[^-]*$)");//拆分最后一个【-】 |
| | | String[] splits = insSample.getFactory().split(" - "); |
| | | String[] splits = StringUtils.isNotEmpty(insSample.getFactory())?insSample.getFactory().split(" - "):new String[0]; |
| | | List<StandardProductList> list = new ArrayList<>(); |
| | | if(splits.length<4){ |
| | | list = standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, models[0],"",""); |
| | |
| | | } |
| | | } |
| | | } |
| | | String[] split1 = insSample.getFactory().split(" - "); |
| | | //判断长度 |
| | | if (split1.length > 4) { |
| | | if (ObjectUtils.isNotEmpty(split1[3])) { |
| | | list = list.stream().filter(list1 -> Objects.nonNull(list1.getSample())&&Objects.equals(list1.getSample(),split1[3])).collect(Collectors.toList()); |
| | | }else if (split1[3].isEmpty()) { |
| | | list = list.stream().filter(list1 -> Objects.nonNull(list1.getSampleType())&&Objects.equals(list1.getSampleType(),split1[2])).collect(Collectors.toList()); |
| | | if (splits.length > 4) { |
| | | if (ObjectUtils.isNotEmpty(splits[3])) { |
| | | list = list.stream().filter(list1 -> Objects.nonNull(list1.getSample())&&Objects.equals(list1.getSample(),splits[3])).collect(Collectors.toList()); |
| | | }else if (splits[3].isEmpty()) { |
| | | list = list.stream().filter(list1 -> Objects.nonNull(list1.getSampleType())&&Objects.equals(list1.getSampleType(),splits[2])).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | list = list.stream().filter(a -> { |