| | |
| | | } |
| | | } |
| | | insProductService.saveBatch(insProductes); |
| | | } else { |
| | | } |
| | | //判断热循环项目的添加和温升试验项目的添加 |
| | | else if (product.getInspectionItem().equals("热循环") || product.getInspectionItem().equals("温升试验")) { |
| | | List<InsProduct> insProductess = new ArrayList<>(); |
| | | insProductess.add(product); |
| | | List<InsProduct> insProductes = new ArrayList<>(); |
| | | List<InsProduct> insProducts = new ArrayList<>(); |
| | | String[] strings = product.getAsk().split(";"); |
| | | //循环次数 |
| | | int count = Integer.parseInt(strings[strings.length - 1]); |
| | | for (int i = 0; i < strings.length - 1; i++) { |
| | | String[] split = strings[i].split(","); |
| | | InsProduct insProduct = new InsProduct(); |
| | | insProduct.setInspectionItem("1");//检验父项--循环次数 |
| | | insProduct.setInspectionItemSubclass(split[0]);//检验子项--环境温度/导线温度/耐张温度/接续温度 |
| | | insProduct.setInspectionItemSubclassEn(split[1]);//检验子项英文--环境温度/导线温度/耐张温度/接续温度 |
| | | insProduct.setAsk(null);//检验要求 |
| | | insProduct.setTell(null);//检验描述 |
| | | insProduct.setInsSampleId(sampleId); |
| | | insProduct.setState(1); |
| | | insProduct.setFactory(product.getFactory()); |
| | | insProduct.setLaboratory(product.getLaboratory()); |
| | | insProduct.setSampleType(product.getSampleType()); |
| | | insProduct.setSample(product.getSample()); |
| | | insProduct.setModel(product.getModel()); |
| | | insProduct.setSonLaboratory(product.getSonLaboratory()); |
| | | insProduct.setUnit("℃");//单位 |
| | | insProduct.setManHourGroup(product.getManHourGroup()); |
| | | insProduct.setInspectionItemType("0"); |
| | | insProduct.setInspectionValueType("1"); |
| | | insProducts.add(insProduct); |
| | | insProductes.add(insProduct); |
| | | insProductess.add(insProduct); |
| | | } |
| | | //热循环才有多次循环次数 |
| | | if (product.getInspectionItem().equals("热循环")) { |
| | | //热循环还要加上直流电阻 |
| | | for (InsProduct insProduct : insProducts) { |
| | | InsProduct insProduct1 = new InsProduct(); |
| | | BeanUtils.copyProperties(insProduct, insProduct1); |
| | | insProduct1.setInspectionItemClass("直流电阻");//检验子子项--直流电阻 |
| | | insProduct1.setInspectionItemClassEn("DC resistance");//检验子子项英文--直流电阻 |
| | | insProduct1.setUnit("Ω/km");//单位 |
| | | insProductes.add(insProduct1); |
| | | insProductess.add(insProduct1); |
| | | } |
| | | } |
| | | if (count > 1) { |
| | | //循环超过1次 |
| | | for (int j = 2; j <= count; j++) { |
| | | for (InsProduct insProduct : insProductes) { |
| | | InsProduct insProduct1 = new InsProduct(); |
| | | BeanUtils.copyProperties(insProduct, insProduct1); |
| | | insProduct1.setInspectionItem(j + "");//循环次数 |
| | | insProductess.add(insProduct1); |
| | | } |
| | | } |
| | | } |
| | | insProductService.saveBatch(insProductess); |
| | | } |
| | | else { |
| | | if (!is) { |
| | | switch (type) { |
| | | case 1: |
| | |
| | | .filter(dto -> dto.getPrice() != null) // 过滤掉价格为 null 的对象 |
| | | .mapToDouble(value -> value.getPrice().doubleValue()) |
| | | .sum(); |
| | | map.put("total",totalPrice); |
| | | map.put("total", totalPrice); |
| | | return map; |
| | | } |
| | | |