| | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.concurrent.CompletableFuture; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | private boolean getIsIf(String str, String model){ |
| | | Matcher matcher = Pattern.compile("\\d+(\\.\\d+)?").matcher(model); |
| | | String model2 = ""; |
| | | while (matcher.find()) { |
| | | model2 += matcher.group(); |
| | | } |
| | | if (str.contains("≥") || str.contains(">=")) { |
| | | String param = str.replace("≥", "").replace(">=", ""); |
| | | return new BigDecimal(model).compareTo(new BigDecimal(param)) > -1; |
| | | return new BigDecimal(model2).compareTo(new BigDecimal(param)) > -1; |
| | | } else if (str.contains("≤") || str.contains("<=")) { |
| | | String param = str.replace("≤", "").replace("<=", ""); |
| | | return new BigDecimal(model).compareTo(new BigDecimal(param)) < 1; |
| | | return new BigDecimal(model2).compareTo(new BigDecimal(param)) < 1; |
| | | } else if (str.contains(">")||str.contains(">")) { |
| | | String param = str.replace(">", "").replace(">", ""); |
| | | return new BigDecimal(model).compareTo(new BigDecimal(param)) > 0; |
| | | return new BigDecimal(model2).compareTo(new BigDecimal(param)) > 0; |
| | | } else if (str.contains("<")||str.contains("<")) { |
| | | String param = str.replace("<", "").replace("<", ""); |
| | | return new BigDecimal(model).compareTo(new BigDecimal(param)) < 0; |
| | | return new BigDecimal(model2).compareTo(new BigDecimal(param)) < 0; |
| | | } else if (str.contains("=")) { |
| | | String param = str.replace("=", ""); |
| | | return new BigDecimal(model).compareTo(new BigDecimal(param)) == 0; |
| | | return new BigDecimal(model2).compareTo(new BigDecimal(param)) == 0; |
| | | } |
| | | return false; |
| | | } |
| | |
| | | for (StandardProductList sp : standardProductLists) { |
| | | for (StandardProductList pl : list) { |
| | | if (Objects.equals(sp.getInspectionItem(), pl.getInspectionItem()) |
| | | && Objects.equals(sp.getInspectionItemSubclass() == null ? "" : sp.getInspectionItemSubclass(), pl.getInspectionItemSubclass() == null ? "" : pl.getInspectionItemSubclass()) |
| | | && Objects.equals((sp.getInspectionItemSubclass() == null)? "" : sp.getInspectionItemSubclass(), pl.getInspectionItemSubclass() == null ? "" : pl.getInspectionItemSubclass()) |
| | | && Objects.equals(sp.getModel(), pl.getModel()) |
| | | && Objects.equals(sp.getStructureItemParameterId(), pl.getStructureItemParameterId())) { |
| | | pl.setId(sp.getId()); |
| | |
| | | if (page == 1) { |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | CompletableFuture.supplyAsync(() -> { |
| | | standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id).like(StandardProductList::getTree, tree)); |
| | | if(trees.length == 5){ |
| | | standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id).eq(StandardProductList::getTree, tree)); |
| | | }else{ |
| | | standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id).like(StandardProductList::getTree, tree)); |
| | | } |
| | | standardProductListService2.saveBatch(list.stream().map(a -> { |
| | | a.setFactory(trees[0]); |
| | | a.setLaboratory(trees[1]); |