| | |
| | | @Override |
| | | public List<StandardProductList> selectStandardProductList(InsSample insSample) { |
| | | String[] models = insSample.getModel().split("-(?=[^-]*$)");//拆分最后一个【-】 |
| | | List<StandardProductList> list = standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, models[0]); |
| | | List<Integer> ids = Arrays.stream(insSample.getStandardMethodListId().split(",")) |
| | | .map(String::trim).map(Integer::parseInt).collect(Collectors.toList()); |
| | | List<StandardProductList> list = standardProductListMapper.selectDetail(ids, 1, models[0]); |
| | | if (list.size() == 0) { |
| | | if (Objects.equals(insSample.getFactory(), "") || insSample.getFactory() == null) { |
| | | return null; |
| | | } |
| | | String[] split = insSample.getFactory().split(" - "); |
| | | String tree = split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3] + " - null"; |
| | | list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree); |
| | | list = standardProductListMapper.selectDetail2(ids, 1, tree); |
| | | if (list.size() == 0) { |
| | | String tree1 = split[0] + " - " + split[1] + " - " + split[2] + " - null - " + split[3]; |
| | | list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree1); |
| | | list = standardProductListMapper.selectDetail2(ids, 1, tree1); |
| | | } |
| | | } |
| | | String[] split1 = insSample.getFactory().split(" - "); |