diff --git a/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml b/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml index 42c5b56..526e278 100644 --- a/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml +++ b/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml @@ -15,12 +15,16 @@ id, data_id, equipment_id, create_time, update_time - + + + + diff --git a/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml b/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml index 42c5b56..526e278 100644 --- a/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml +++ b/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml @@ -15,12 +15,16 @@ id, data_id, equipment_id, create_time, update_time - + + + + diff --git a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java index 21d48ff..afc322a 100644 --- a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java +++ b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java @@ -70,6 +70,7 @@ for (int i = 0; i < pointList.size(); i++) { String points = pointList.get(i); + //重复性 List repList = request.getCheckDataDcPowerList() .stream().filter(e -> points.equals(e.getCheckParam()) && checkTypes[0].equals(e.getCheckType()) @@ -82,7 +83,7 @@ } map.put(REPEAT_PREFIX + (i + 1), repMapList); } - + //稳定性 List staList = request.getCheckDataDcPowerList() .stream().filter(e -> points.equals(e.getCheckParam()) && checkTypes[1].equals(e.getCheckType()) @@ -98,7 +99,11 @@ List repMapList = new ArrayList<>(); for (BizEquipmentStandardCheckDataDcPower sta : staList) { Map repMap = BeanUtil.beanToMap(sta); - repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); + if (sta.getLessThan() != null) { + repMap.put("lessThan", 0 == sta.getLessThan() ? "否" : "是"); + }else { + repMap.put("lessThan",""); + } repMapList.add(repMap); } map.put(STA_PREFIX + (i + 1) + UP_STANDARD, "\uF0A3"); @@ -125,21 +130,25 @@ map.put(REPEAT_PREFIX + 5, repMapList); } - // || StringUtils.isNotEmpty(d.getTestValueOneDate()) - // || StringUtils.isNotEmpty(d.getTestValueTwoDate()) - // || StringUtils.isNotEmpty(d.getTestValueThreeDate()) - // || StringUtils.isNotEmpty(d.getTestValueFourDate()) - // || StringUtils.isNotEmpty(d.getTestValueFiveDate()) - // || StringUtils.isNotEmpty(d.getTestValueSixDate()) List staList = request.getCheckDataDcPowerList().stream() .filter(d -> RIPPLE_VOLTAGE.equals(d.getCheckParam()) - && checkTypes[1].equals(d.getCheckType())).collect(Collectors.toList()); + && checkTypes[1].equals(d.getCheckType()) + && (StringUtils.isNotEmpty(d.getTestValueOneDate()) + || StringUtils.isNotEmpty(d.getTestValueTwoDate()) + || StringUtils.isNotEmpty(d.getTestValueThreeDate()) + || StringUtils.isNotEmpty(d.getTestValueFourDate()) + || StringUtils.isNotEmpty(d.getTestValueFiveDate()) + || StringUtils.isNotEmpty(d.getTestValueSixDate()))).collect(Collectors.toList()); if (!CollectionUtils.isEmpty(staList)) { statisticalDate(staList, STA_PREFIX + 5, map); List repMapList = new ArrayList<>(); for (BizEquipmentStandardCheckDataDcPower sta : staList) { Map repMap = BeanUtil.beanToMap(sta); - repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); + if (sta.getLessThan() != null) { + repMap.put("lessThan", 0 == sta.getLessThan() ? "否" : "是"); + }else { + repMap.put("lessThan",""); + } repMapList.add(repMap); } map.put(STA_PREFIX + 5 + UP_STANDARD, "\uF0A3"); @@ -255,12 +264,20 @@ //波纹电压 List rippleList = dcPowerList.stream() .filter(dcPower -> "6".equals(dcPower.getDataType())).map(dcPower -> { - dcPower.setTechnicalIndex(dcPower.getTechnicalIndexSymbol() + dcPower.getTechnicalIndex() + "mV"); + dcPower.setTechnicalIndex(dcPower.getTechnicalIndexSymbol() + dcPower.getTechnicalIndex() + "%"); dcPower.setRippleVoltage(dcPower.getRippleVoltage() + "mV"); return dcPower; }).collect(Collectors.toList()); + //输出电压短期稳定性 + List shortRepList = dcPowerList.stream() + .filter(dcPower -> "7".equals(dcPower.getDataType())) + .peek(dcPower -> { + dcPower.setTechnicalIndex(dcPower.getTechnicalIndexSymbol() + dcPower.getTechnicalIndex() + "%"); + dcPower.setShortTermStability(dcPower.getShortTermStability() + "%"); + }).collect(Collectors.toList()); + map.put("shortRepList", shortRepList); map.put("powerSupplyVoltageAdjustmentList", powerSupplyVoltageAdjustmentList); map.put("loadRegulationList", loadRegulationList); map.put("voltageRepresentationErrorList", voltageRepresentationErrorList); @@ -353,7 +370,7 @@ } map.put("equipmentList", equipmentList); List dcPowerList = request.getMeasureDataDcPowerList(); - + //电源电压调整率 List powerSupplyVoltageAdjustmentList = dcPowerList.stream() .filter(dcPower -> "1".equals(dcPower.getDataType())).collect(Collectors.toList()); @@ -378,6 +395,9 @@ List rippleList = dcPowerList.stream() .filter(dcPower -> "6".equals(dcPower.getDataType())).collect(Collectors.toList()); + //输出电压短期稳定性 + List shortRepList = dcPowerList.stream() + .filter(dcPower -> "7".equals(dcPower.getDataType())).collect(Collectors.toList()); map.put("powerSupplyVoltageAdjustmentList", powerSupplyVoltageAdjustmentList); map.put("loadRegulationList", loadRegulationList); @@ -385,6 +405,7 @@ map.put("directMeasurementList", directMeasurementList); map.put("indirectMeasurementList", indirectMeasurementList); map.put("rippleList", rippleList); + map.put("shortRepList", shortRepList); prepareCoverParams(map, request.getLabCode()); List customTemplateUrls = new ArrayList<>(); diff --git a/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml b/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml index 42c5b56..526e278 100644 --- a/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml +++ b/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml @@ -15,12 +15,16 @@ id, data_id, equipment_id, create_time, update_time - + + + + diff --git a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java index 21d48ff..afc322a 100644 --- a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java +++ b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java @@ -70,6 +70,7 @@ for (int i = 0; i < pointList.size(); i++) { String points = pointList.get(i); + //重复性 List repList = request.getCheckDataDcPowerList() .stream().filter(e -> points.equals(e.getCheckParam()) && checkTypes[0].equals(e.getCheckType()) @@ -82,7 +83,7 @@ } map.put(REPEAT_PREFIX + (i + 1), repMapList); } - + //稳定性 List staList = request.getCheckDataDcPowerList() .stream().filter(e -> points.equals(e.getCheckParam()) && checkTypes[1].equals(e.getCheckType()) @@ -98,7 +99,11 @@ List repMapList = new ArrayList<>(); for (BizEquipmentStandardCheckDataDcPower sta : staList) { Map repMap = BeanUtil.beanToMap(sta); - repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); + if (sta.getLessThan() != null) { + repMap.put("lessThan", 0 == sta.getLessThan() ? "否" : "是"); + }else { + repMap.put("lessThan",""); + } repMapList.add(repMap); } map.put(STA_PREFIX + (i + 1) + UP_STANDARD, "\uF0A3"); @@ -125,21 +130,25 @@ map.put(REPEAT_PREFIX + 5, repMapList); } - // || StringUtils.isNotEmpty(d.getTestValueOneDate()) - // || StringUtils.isNotEmpty(d.getTestValueTwoDate()) - // || StringUtils.isNotEmpty(d.getTestValueThreeDate()) - // || StringUtils.isNotEmpty(d.getTestValueFourDate()) - // || StringUtils.isNotEmpty(d.getTestValueFiveDate()) - // || StringUtils.isNotEmpty(d.getTestValueSixDate()) List staList = request.getCheckDataDcPowerList().stream() .filter(d -> RIPPLE_VOLTAGE.equals(d.getCheckParam()) - && checkTypes[1].equals(d.getCheckType())).collect(Collectors.toList()); + && checkTypes[1].equals(d.getCheckType()) + && (StringUtils.isNotEmpty(d.getTestValueOneDate()) + || StringUtils.isNotEmpty(d.getTestValueTwoDate()) + || StringUtils.isNotEmpty(d.getTestValueThreeDate()) + || StringUtils.isNotEmpty(d.getTestValueFourDate()) + || StringUtils.isNotEmpty(d.getTestValueFiveDate()) + || StringUtils.isNotEmpty(d.getTestValueSixDate()))).collect(Collectors.toList()); if (!CollectionUtils.isEmpty(staList)) { statisticalDate(staList, STA_PREFIX + 5, map); List repMapList = new ArrayList<>(); for (BizEquipmentStandardCheckDataDcPower sta : staList) { Map repMap = BeanUtil.beanToMap(sta); - repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); + if (sta.getLessThan() != null) { + repMap.put("lessThan", 0 == sta.getLessThan() ? "否" : "是"); + }else { + repMap.put("lessThan",""); + } repMapList.add(repMap); } map.put(STA_PREFIX + 5 + UP_STANDARD, "\uF0A3"); @@ -255,12 +264,20 @@ //波纹电压 List rippleList = dcPowerList.stream() .filter(dcPower -> "6".equals(dcPower.getDataType())).map(dcPower -> { - dcPower.setTechnicalIndex(dcPower.getTechnicalIndexSymbol() + dcPower.getTechnicalIndex() + "mV"); + dcPower.setTechnicalIndex(dcPower.getTechnicalIndexSymbol() + dcPower.getTechnicalIndex() + "%"); dcPower.setRippleVoltage(dcPower.getRippleVoltage() + "mV"); return dcPower; }).collect(Collectors.toList()); + //输出电压短期稳定性 + List shortRepList = dcPowerList.stream() + .filter(dcPower -> "7".equals(dcPower.getDataType())) + .peek(dcPower -> { + dcPower.setTechnicalIndex(dcPower.getTechnicalIndexSymbol() + dcPower.getTechnicalIndex() + "%"); + dcPower.setShortTermStability(dcPower.getShortTermStability() + "%"); + }).collect(Collectors.toList()); + map.put("shortRepList", shortRepList); map.put("powerSupplyVoltageAdjustmentList", powerSupplyVoltageAdjustmentList); map.put("loadRegulationList", loadRegulationList); map.put("voltageRepresentationErrorList", voltageRepresentationErrorList); @@ -353,7 +370,7 @@ } map.put("equipmentList", equipmentList); List dcPowerList = request.getMeasureDataDcPowerList(); - + //电源电压调整率 List powerSupplyVoltageAdjustmentList = dcPowerList.stream() .filter(dcPower -> "1".equals(dcPower.getDataType())).collect(Collectors.toList()); @@ -378,6 +395,9 @@ List rippleList = dcPowerList.stream() .filter(dcPower -> "6".equals(dcPower.getDataType())).collect(Collectors.toList()); + //输出电压短期稳定性 + List shortRepList = dcPowerList.stream() + .filter(dcPower -> "7".equals(dcPower.getDataType())).collect(Collectors.toList()); map.put("powerSupplyVoltageAdjustmentList", powerSupplyVoltageAdjustmentList); map.put("loadRegulationList", loadRegulationList); @@ -385,6 +405,7 @@ map.put("directMeasurementList", directMeasurementList); map.put("indirectMeasurementList", indirectMeasurementList); map.put("rippleList", rippleList); + map.put("shortRepList", shortRepList); prepareCoverParams(map, request.getLabCode()); List customTemplateUrls = new ArrayList<>(); diff --git a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ETwoWeightHandler.java b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ETwoWeightHandler.java index 95eb149..c5ac4e4 100644 --- a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ETwoWeightHandler.java +++ b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ETwoWeightHandler.java @@ -80,149 +80,9 @@ Map map = BeanUtil.beanToMap(request); List eTwoList = request.getCheckDataETwoList(); - List checkPointList = eTwoList.stream() - .map(BizEquipmentStandardCheckDataETwo::getCheckPoint) - .distinct() - .collect(Collectors.toList()); - List> repList = new ArrayList<>(); - for (String s : checkPointList) { - List> aOneList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map aOneMap = new HashMap<>(); - aOneMap.put("checkPoint", s); - aOneMap.put("project", "A1(" + "Ιᵣ₁ᵢ)"); - aOneMap.put("unit", e.getUnit()); - aOneMap.put("oneValue", e.getAOneValueOne()); - aOneMap.put("twoValue", e.getAOneValueTwo()); - aOneMap.put("threeValue", e.getAOneValueThree()); - aOneMap.put("fourValue", e.getAOneValueFour()); - aOneMap.put("fiveValue", e.getAOneValueFive()); - aOneMap.put("sixValue", e.getAOneValueSix()); - return aOneMap; - }) - .collect(Collectors.toList()); - repList.add(aOneList.get(0)); - List> bOneList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map bOneMap = new HashMap<>(); - bOneMap.put("checkPoint", s); - bOneMap.put("project", "B1(" + "Ιᵣ₁ᵢ)"); - bOneMap.put("unit", e.getUnit()); - bOneMap.put("oneValue", e.getBOneValueOne()); - bOneMap.put("twoValue", e.getBOneValueTwo()); - bOneMap.put("threeValue", e.getBOneValueThree()); - bOneMap.put("fourValue", e.getBOneValueFour()); - bOneMap.put("fiveValue", e.getBOneValueFive()); - bOneMap.put("sixValue", e.getBOneValueSix()); - return bOneMap; - }).collect(Collectors.toList()); - repList.add(bOneList.get(0)); - List> bTwoList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map bTwoMap = new HashMap<>(); - bTwoMap.put("checkPoint", s); - bTwoMap.put("project", "B2(" + "Ιᵣ₂ᵢ)"); - bTwoMap.put("unit", e.getUnit()); - bTwoMap.put("oneValue", e.getBTwoValueOne()); - bTwoMap.put("twoValue", e.getBTwoValueTwo()); - bTwoMap.put("threeValue", e.getBTwoValueThree()); - bTwoMap.put("fourValue", e.getBTwoValueFour()); - bTwoMap.put("fiveValue", e.getBTwoValueFive()); - bTwoMap.put("sixValue", e.getBTwoValueSix()); - return bTwoMap; - }).collect(Collectors.toList()); - repList.add(bTwoList.get(0)); - List> aTwoList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map aTwoMap = new HashMap<>(); - aTwoMap.put("checkPoint", s); - aTwoMap.put("project", "A2(" + "Ιᵣ₂ᵢ)"); - aTwoMap.put("unit", e.getUnit()); - aTwoMap.put("oneValue", e.getATwoValueOne()); - aTwoMap.put("twoValue", e.getATwoValueTwo()); - aTwoMap.put("threeValue", e.getATwoValueThree()); - aTwoMap.put("fourValue", e.getATwoValueFour()); - aTwoMap.put("fiveValue", e.getATwoValueFive()); - aTwoMap.put("sixValue", e.getATwoValueSix()); - return aTwoMap; - }).collect(Collectors.toList()); - repList.add(aTwoList.get(0)); - List> deltaIotaList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map deltaIotaMap = new HashMap<>(); - deltaIotaMap.put("checkPoint", s); - deltaIotaMap.put("project", "Δ" + "Ιᵢ"); - deltaIotaMap.put("unit", e.getUnit()); - deltaIotaMap.put("oneValue", e.getAverageValueOne()); - deltaIotaMap.put("twoValue", e.getAverageValueTwo()); - deltaIotaMap.put("threeValue", e.getAverageValueThree()); - deltaIotaMap.put("fourValue", e.getAverageValueFour()); - deltaIotaMap.put("fiveValue", e.getAverageValueFive()); - deltaIotaMap.put("sixValue", e.getAverageValueSix()); - return deltaIotaMap; - }).collect(Collectors.toList()); - repList.add(deltaIotaList.get(0)); - List> deltajList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map deltajMap = new HashMap<>(); - deltajMap.put("checkPoint", s); - deltajMap.put("project", "Δ" + "Ιʲ"); - deltajMap.put("unit", e.getUnit()); - deltajMap.put("oneValue", e.getAverageValue()); - deltajMap.put("twoValue", e.getAverageValue()); - deltajMap.put("threeValue", e.getAverageValue()); - deltajMap.put("fourValue", e.getAverageValue()); - deltajMap.put("fiveValue", e.getAverageValue()); - deltajMap.put("sixValue", e.getAverageValue()); - return deltajMap; - }).collect(Collectors.toList()); - repList.add(deltajList.get(0)); - List> snList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map snMap = new HashMap<>(); - snMap.put("checkPoint", s); - snMap.put("project", "Sn"); - snMap.put("unit", e.getUnit()); - snMap.put("oneValue", e.getAverageValue()); - snMap.put("twoValue", e.getAverageValue()); - snMap.put("threeValue", e.getAverageValue()); - snMap.put("fourValue", e.getAverageValue()); - snMap.put("fiveValue", e.getAverageValue()); - snMap.put("sixValue", e.getAverageValue()); - return snMap; - }).collect(Collectors.toList()); - repList.add(snList.get(0)); - map.put("repList", repList); - } - - List staList = request.getCheckDataETwoList() - .stream().filter(e -> STABILITY.equals(e.getCheckType()) - && (StringUtils.isNotEmpty(e.getTestValueOneDate()) - || StringUtils.isNotEmpty(e.getTestValueTwoDate()) - || StringUtils.isNotEmpty(e.getTestValueThreeDate()) - || StringUtils.isNotEmpty(e.getTestValueFourDate()) - || StringUtils.isNotEmpty(e.getTestValueFiveDate()) - || StringUtils.isNotEmpty(e.getTestValueSixDate())) - ).collect(Collectors.toList()); - if (!CollectionUtils.isEmpty(staList)) { - statisticalDate(staList, STA_PREFIX, map); - List repMapList = new ArrayList<>(); - for (BizEquipmentStandardCheckDataETwo sta : staList) { - Map repMap = BeanUtil.beanToMap(sta); - repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); - repMapList.add(repMap); - } - map.put("staList", repMapList); - } + prepareCheckParams(eTwoList, map); //除了选用的模板不一致,模板配置流程是一致的 String wordUrl = printFileRegister.registerPrintFile(ETWO_WEIGHT_CHECK_DATA, "数据打印", null, map, false, null, null); @@ -241,6 +101,162 @@ } /** + * 核查填充参数 + * @param eTwoList + * @param map + */ + private void prepareCheckParams(List eTwoList, Map map) { + List checkPointList = eTwoList.stream() + .map(BizEquipmentStandardCheckDataETwo::getCheckPoint) + .distinct() + .collect(Collectors.toList()); + List> repList = new ArrayList<>(); + for (String s : checkPointList) { + //A1 + List> aOneList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map aOneMap = new HashMap<>(); + aOneMap.put("checkPoint", s); + aOneMap.put("project", "A1(" + "Ιᵣ₁ᵢ)"); + aOneMap.put("unit", e.getUnit()); + aOneMap.put("oneValue", e.getAOneValueOne()); + aOneMap.put("twoValue", e.getAOneValueTwo()); + aOneMap.put("threeValue", e.getAOneValueThree()); + aOneMap.put("fourValue", e.getAOneValueFour()); + aOneMap.put("fiveValue", e.getAOneValueFive()); + aOneMap.put("sixValue", e.getAOneValueSix()); + return aOneMap; + }) + .collect(Collectors.toList()); + repList.add(aOneList.get(0)); + //B1 + List> bOneList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map bOneMap = new HashMap<>(); + bOneMap.put("checkPoint", s); + bOneMap.put("project", "B1(" + "Ιᵣ₁ᵢ)"); + bOneMap.put("unit", e.getUnit()); + bOneMap.put("oneValue", e.getBOneValueOne()); + bOneMap.put("twoValue", e.getBOneValueTwo()); + bOneMap.put("threeValue", e.getBOneValueThree()); + bOneMap.put("fourValue", e.getBOneValueFour()); + bOneMap.put("fiveValue", e.getBOneValueFive()); + bOneMap.put("sixValue", e.getBOneValueSix()); + return bOneMap; + }).collect(Collectors.toList()); + repList.add(bOneList.get(0)); + //B2 + List> bTwoList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map bTwoMap = new HashMap<>(); + bTwoMap.put("checkPoint", s); + bTwoMap.put("project", "B2(" + "Ιᵣ₂ᵢ)"); + bTwoMap.put("unit", e.getUnit()); + bTwoMap.put("oneValue", e.getBTwoValueOne()); + bTwoMap.put("twoValue", e.getBTwoValueTwo()); + bTwoMap.put("threeValue", e.getBTwoValueThree()); + bTwoMap.put("fourValue", e.getBTwoValueFour()); + bTwoMap.put("fiveValue", e.getBTwoValueFive()); + bTwoMap.put("sixValue", e.getBTwoValueSix()); + return bTwoMap; + }).collect(Collectors.toList()); + repList.add(bTwoList.get(0)); + //A2 + List> aTwoList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map aTwoMap = new HashMap<>(); + aTwoMap.put("checkPoint", s); + aTwoMap.put("project", "A2(" + "Ιᵣ₂ᵢ)"); + aTwoMap.put("unit", e.getUnit()); + aTwoMap.put("oneValue", e.getATwoValueOne()); + aTwoMap.put("twoValue", e.getATwoValueTwo()); + aTwoMap.put("threeValue", e.getATwoValueThree()); + aTwoMap.put("fourValue", e.getATwoValueFour()); + aTwoMap.put("fiveValue", e.getATwoValueFive()); + aTwoMap.put("sixValue", e.getATwoValueSix()); + return aTwoMap; + }).collect(Collectors.toList()); + repList.add(aTwoList.get(0)); + //Δi + List> deltaIotaList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map deltaIotaMap = new HashMap<>(); + deltaIotaMap.put("checkPoint", s); + deltaIotaMap.put("project", "Δ" + "Ιᵢ"); + deltaIotaMap.put("unit", e.getUnit()); + deltaIotaMap.put("oneValue", e.getAverageValueOne()); + deltaIotaMap.put("twoValue", e.getAverageValueTwo()); + deltaIotaMap.put("threeValue", e.getAverageValueThree()); + deltaIotaMap.put("fourValue", e.getAverageValueFour()); + deltaIotaMap.put("fiveValue", e.getAverageValueFive()); + deltaIotaMap.put("sixValue", e.getAverageValueSix()); + return deltaIotaMap; + }).collect(Collectors.toList()); + repList.add(deltaIotaList.get(0)); + // Δj + List> deltajList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map deltajMap = new HashMap<>(); + deltajMap.put("checkPoint", s); + deltajMap.put("project", "Δ" + "Ιʲ"); + deltajMap.put("unit", e.getUnit()); + deltajMap.put("oneValue", e.getAverageValue()); + deltajMap.put("twoValue", e.getAverageValue()); + deltajMap.put("threeValue", e.getAverageValue()); + deltajMap.put("fourValue", e.getAverageValue()); + deltajMap.put("fiveValue", e.getAverageValue()); + deltajMap.put("sixValue", e.getAverageValue()); + return deltajMap; + }).collect(Collectors.toList()); + repList.add(deltajList.get(0)); + //Sn + List> snList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map snMap = new HashMap<>(); + snMap.put("checkPoint", s); + snMap.put("project", "Sn"); + snMap.put("unit", e.getUnit()); + snMap.put("oneValue", e.getAverageValue()); + snMap.put("twoValue", e.getAverageValue()); + snMap.put("threeValue", e.getAverageValue()); + snMap.put("fourValue", e.getAverageValue()); + snMap.put("fiveValue", e.getAverageValue()); + snMap.put("sixValue", e.getAverageValue()); + return snMap; + }).collect(Collectors.toList()); + repList.add(snList.get(0)); + map.put("repList", repList); + } + + List staList = eTwoList + .stream().filter(e -> STABILITY.equals(e.getCheckType()) + && (StringUtils.isNotEmpty(e.getTestValueOneDate()) + || StringUtils.isNotEmpty(e.getTestValueTwoDate()) + || StringUtils.isNotEmpty(e.getTestValueThreeDate()) + || StringUtils.isNotEmpty(e.getTestValueFourDate()) + || StringUtils.isNotEmpty(e.getTestValueFiveDate()) + || StringUtils.isNotEmpty(e.getTestValueSixDate())) + ).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(staList)) { + statisticalDate(staList, STA_PREFIX, map); + List repMapList = new ArrayList<>(); + for (BizEquipmentStandardCheckDataETwo sta : staList) { + Map repMap = BeanUtil.beanToMap(sta); + repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); + repMapList.add(repMap); + } + map.put("staList", repMapList); + } + } + + /** * 组装参数 * * @param sta diff --git a/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml b/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml index 42c5b56..526e278 100644 --- a/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml +++ b/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml @@ -15,12 +15,16 @@ id, data_id, equipment_id, create_time, update_time - + + + + diff --git a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java index 21d48ff..afc322a 100644 --- a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java +++ b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java @@ -70,6 +70,7 @@ for (int i = 0; i < pointList.size(); i++) { String points = pointList.get(i); + //重复性 List repList = request.getCheckDataDcPowerList() .stream().filter(e -> points.equals(e.getCheckParam()) && checkTypes[0].equals(e.getCheckType()) @@ -82,7 +83,7 @@ } map.put(REPEAT_PREFIX + (i + 1), repMapList); } - + //稳定性 List staList = request.getCheckDataDcPowerList() .stream().filter(e -> points.equals(e.getCheckParam()) && checkTypes[1].equals(e.getCheckType()) @@ -98,7 +99,11 @@ List repMapList = new ArrayList<>(); for (BizEquipmentStandardCheckDataDcPower sta : staList) { Map repMap = BeanUtil.beanToMap(sta); - repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); + if (sta.getLessThan() != null) { + repMap.put("lessThan", 0 == sta.getLessThan() ? "否" : "是"); + }else { + repMap.put("lessThan",""); + } repMapList.add(repMap); } map.put(STA_PREFIX + (i + 1) + UP_STANDARD, "\uF0A3"); @@ -125,21 +130,25 @@ map.put(REPEAT_PREFIX + 5, repMapList); } - // || StringUtils.isNotEmpty(d.getTestValueOneDate()) - // || StringUtils.isNotEmpty(d.getTestValueTwoDate()) - // || StringUtils.isNotEmpty(d.getTestValueThreeDate()) - // || StringUtils.isNotEmpty(d.getTestValueFourDate()) - // || StringUtils.isNotEmpty(d.getTestValueFiveDate()) - // || StringUtils.isNotEmpty(d.getTestValueSixDate()) List staList = request.getCheckDataDcPowerList().stream() .filter(d -> RIPPLE_VOLTAGE.equals(d.getCheckParam()) - && checkTypes[1].equals(d.getCheckType())).collect(Collectors.toList()); + && checkTypes[1].equals(d.getCheckType()) + && (StringUtils.isNotEmpty(d.getTestValueOneDate()) + || StringUtils.isNotEmpty(d.getTestValueTwoDate()) + || StringUtils.isNotEmpty(d.getTestValueThreeDate()) + || StringUtils.isNotEmpty(d.getTestValueFourDate()) + || StringUtils.isNotEmpty(d.getTestValueFiveDate()) + || StringUtils.isNotEmpty(d.getTestValueSixDate()))).collect(Collectors.toList()); if (!CollectionUtils.isEmpty(staList)) { statisticalDate(staList, STA_PREFIX + 5, map); List repMapList = new ArrayList<>(); for (BizEquipmentStandardCheckDataDcPower sta : staList) { Map repMap = BeanUtil.beanToMap(sta); - repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); + if (sta.getLessThan() != null) { + repMap.put("lessThan", 0 == sta.getLessThan() ? "否" : "是"); + }else { + repMap.put("lessThan",""); + } repMapList.add(repMap); } map.put(STA_PREFIX + 5 + UP_STANDARD, "\uF0A3"); @@ -255,12 +264,20 @@ //波纹电压 List rippleList = dcPowerList.stream() .filter(dcPower -> "6".equals(dcPower.getDataType())).map(dcPower -> { - dcPower.setTechnicalIndex(dcPower.getTechnicalIndexSymbol() + dcPower.getTechnicalIndex() + "mV"); + dcPower.setTechnicalIndex(dcPower.getTechnicalIndexSymbol() + dcPower.getTechnicalIndex() + "%"); dcPower.setRippleVoltage(dcPower.getRippleVoltage() + "mV"); return dcPower; }).collect(Collectors.toList()); + //输出电压短期稳定性 + List shortRepList = dcPowerList.stream() + .filter(dcPower -> "7".equals(dcPower.getDataType())) + .peek(dcPower -> { + dcPower.setTechnicalIndex(dcPower.getTechnicalIndexSymbol() + dcPower.getTechnicalIndex() + "%"); + dcPower.setShortTermStability(dcPower.getShortTermStability() + "%"); + }).collect(Collectors.toList()); + map.put("shortRepList", shortRepList); map.put("powerSupplyVoltageAdjustmentList", powerSupplyVoltageAdjustmentList); map.put("loadRegulationList", loadRegulationList); map.put("voltageRepresentationErrorList", voltageRepresentationErrorList); @@ -353,7 +370,7 @@ } map.put("equipmentList", equipmentList); List dcPowerList = request.getMeasureDataDcPowerList(); - + //电源电压调整率 List powerSupplyVoltageAdjustmentList = dcPowerList.stream() .filter(dcPower -> "1".equals(dcPower.getDataType())).collect(Collectors.toList()); @@ -378,6 +395,9 @@ List rippleList = dcPowerList.stream() .filter(dcPower -> "6".equals(dcPower.getDataType())).collect(Collectors.toList()); + //输出电压短期稳定性 + List shortRepList = dcPowerList.stream() + .filter(dcPower -> "7".equals(dcPower.getDataType())).collect(Collectors.toList()); map.put("powerSupplyVoltageAdjustmentList", powerSupplyVoltageAdjustmentList); map.put("loadRegulationList", loadRegulationList); @@ -385,6 +405,7 @@ map.put("directMeasurementList", directMeasurementList); map.put("indirectMeasurementList", indirectMeasurementList); map.put("rippleList", rippleList); + map.put("shortRepList", shortRepList); prepareCoverParams(map, request.getLabCode()); List customTemplateUrls = new ArrayList<>(); diff --git a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ETwoWeightHandler.java b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ETwoWeightHandler.java index 95eb149..c5ac4e4 100644 --- a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ETwoWeightHandler.java +++ b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ETwoWeightHandler.java @@ -80,149 +80,9 @@ Map map = BeanUtil.beanToMap(request); List eTwoList = request.getCheckDataETwoList(); - List checkPointList = eTwoList.stream() - .map(BizEquipmentStandardCheckDataETwo::getCheckPoint) - .distinct() - .collect(Collectors.toList()); - List> repList = new ArrayList<>(); - for (String s : checkPointList) { - List> aOneList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map aOneMap = new HashMap<>(); - aOneMap.put("checkPoint", s); - aOneMap.put("project", "A1(" + "Ιᵣ₁ᵢ)"); - aOneMap.put("unit", e.getUnit()); - aOneMap.put("oneValue", e.getAOneValueOne()); - aOneMap.put("twoValue", e.getAOneValueTwo()); - aOneMap.put("threeValue", e.getAOneValueThree()); - aOneMap.put("fourValue", e.getAOneValueFour()); - aOneMap.put("fiveValue", e.getAOneValueFive()); - aOneMap.put("sixValue", e.getAOneValueSix()); - return aOneMap; - }) - .collect(Collectors.toList()); - repList.add(aOneList.get(0)); - List> bOneList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map bOneMap = new HashMap<>(); - bOneMap.put("checkPoint", s); - bOneMap.put("project", "B1(" + "Ιᵣ₁ᵢ)"); - bOneMap.put("unit", e.getUnit()); - bOneMap.put("oneValue", e.getBOneValueOne()); - bOneMap.put("twoValue", e.getBOneValueTwo()); - bOneMap.put("threeValue", e.getBOneValueThree()); - bOneMap.put("fourValue", e.getBOneValueFour()); - bOneMap.put("fiveValue", e.getBOneValueFive()); - bOneMap.put("sixValue", e.getBOneValueSix()); - return bOneMap; - }).collect(Collectors.toList()); - repList.add(bOneList.get(0)); - List> bTwoList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map bTwoMap = new HashMap<>(); - bTwoMap.put("checkPoint", s); - bTwoMap.put("project", "B2(" + "Ιᵣ₂ᵢ)"); - bTwoMap.put("unit", e.getUnit()); - bTwoMap.put("oneValue", e.getBTwoValueOne()); - bTwoMap.put("twoValue", e.getBTwoValueTwo()); - bTwoMap.put("threeValue", e.getBTwoValueThree()); - bTwoMap.put("fourValue", e.getBTwoValueFour()); - bTwoMap.put("fiveValue", e.getBTwoValueFive()); - bTwoMap.put("sixValue", e.getBTwoValueSix()); - return bTwoMap; - }).collect(Collectors.toList()); - repList.add(bTwoList.get(0)); - List> aTwoList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map aTwoMap = new HashMap<>(); - aTwoMap.put("checkPoint", s); - aTwoMap.put("project", "A2(" + "Ιᵣ₂ᵢ)"); - aTwoMap.put("unit", e.getUnit()); - aTwoMap.put("oneValue", e.getATwoValueOne()); - aTwoMap.put("twoValue", e.getATwoValueTwo()); - aTwoMap.put("threeValue", e.getATwoValueThree()); - aTwoMap.put("fourValue", e.getATwoValueFour()); - aTwoMap.put("fiveValue", e.getATwoValueFive()); - aTwoMap.put("sixValue", e.getATwoValueSix()); - return aTwoMap; - }).collect(Collectors.toList()); - repList.add(aTwoList.get(0)); - List> deltaIotaList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map deltaIotaMap = new HashMap<>(); - deltaIotaMap.put("checkPoint", s); - deltaIotaMap.put("project", "Δ" + "Ιᵢ"); - deltaIotaMap.put("unit", e.getUnit()); - deltaIotaMap.put("oneValue", e.getAverageValueOne()); - deltaIotaMap.put("twoValue", e.getAverageValueTwo()); - deltaIotaMap.put("threeValue", e.getAverageValueThree()); - deltaIotaMap.put("fourValue", e.getAverageValueFour()); - deltaIotaMap.put("fiveValue", e.getAverageValueFive()); - deltaIotaMap.put("sixValue", e.getAverageValueSix()); - return deltaIotaMap; - }).collect(Collectors.toList()); - repList.add(deltaIotaList.get(0)); - List> deltajList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map deltajMap = new HashMap<>(); - deltajMap.put("checkPoint", s); - deltajMap.put("project", "Δ" + "Ιʲ"); - deltajMap.put("unit", e.getUnit()); - deltajMap.put("oneValue", e.getAverageValue()); - deltajMap.put("twoValue", e.getAverageValue()); - deltajMap.put("threeValue", e.getAverageValue()); - deltajMap.put("fourValue", e.getAverageValue()); - deltajMap.put("fiveValue", e.getAverageValue()); - deltajMap.put("sixValue", e.getAverageValue()); - return deltajMap; - }).collect(Collectors.toList()); - repList.add(deltajList.get(0)); - List> snList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map snMap = new HashMap<>(); - snMap.put("checkPoint", s); - snMap.put("project", "Sn"); - snMap.put("unit", e.getUnit()); - snMap.put("oneValue", e.getAverageValue()); - snMap.put("twoValue", e.getAverageValue()); - snMap.put("threeValue", e.getAverageValue()); - snMap.put("fourValue", e.getAverageValue()); - snMap.put("fiveValue", e.getAverageValue()); - snMap.put("sixValue", e.getAverageValue()); - return snMap; - }).collect(Collectors.toList()); - repList.add(snList.get(0)); - map.put("repList", repList); - } - - List staList = request.getCheckDataETwoList() - .stream().filter(e -> STABILITY.equals(e.getCheckType()) - && (StringUtils.isNotEmpty(e.getTestValueOneDate()) - || StringUtils.isNotEmpty(e.getTestValueTwoDate()) - || StringUtils.isNotEmpty(e.getTestValueThreeDate()) - || StringUtils.isNotEmpty(e.getTestValueFourDate()) - || StringUtils.isNotEmpty(e.getTestValueFiveDate()) - || StringUtils.isNotEmpty(e.getTestValueSixDate())) - ).collect(Collectors.toList()); - if (!CollectionUtils.isEmpty(staList)) { - statisticalDate(staList, STA_PREFIX, map); - List repMapList = new ArrayList<>(); - for (BizEquipmentStandardCheckDataETwo sta : staList) { - Map repMap = BeanUtil.beanToMap(sta); - repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); - repMapList.add(repMap); - } - map.put("staList", repMapList); - } + prepareCheckParams(eTwoList, map); //除了选用的模板不一致,模板配置流程是一致的 String wordUrl = printFileRegister.registerPrintFile(ETWO_WEIGHT_CHECK_DATA, "数据打印", null, map, false, null, null); @@ -241,6 +101,162 @@ } /** + * 核查填充参数 + * @param eTwoList + * @param map + */ + private void prepareCheckParams(List eTwoList, Map map) { + List checkPointList = eTwoList.stream() + .map(BizEquipmentStandardCheckDataETwo::getCheckPoint) + .distinct() + .collect(Collectors.toList()); + List> repList = new ArrayList<>(); + for (String s : checkPointList) { + //A1 + List> aOneList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map aOneMap = new HashMap<>(); + aOneMap.put("checkPoint", s); + aOneMap.put("project", "A1(" + "Ιᵣ₁ᵢ)"); + aOneMap.put("unit", e.getUnit()); + aOneMap.put("oneValue", e.getAOneValueOne()); + aOneMap.put("twoValue", e.getAOneValueTwo()); + aOneMap.put("threeValue", e.getAOneValueThree()); + aOneMap.put("fourValue", e.getAOneValueFour()); + aOneMap.put("fiveValue", e.getAOneValueFive()); + aOneMap.put("sixValue", e.getAOneValueSix()); + return aOneMap; + }) + .collect(Collectors.toList()); + repList.add(aOneList.get(0)); + //B1 + List> bOneList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map bOneMap = new HashMap<>(); + bOneMap.put("checkPoint", s); + bOneMap.put("project", "B1(" + "Ιᵣ₁ᵢ)"); + bOneMap.put("unit", e.getUnit()); + bOneMap.put("oneValue", e.getBOneValueOne()); + bOneMap.put("twoValue", e.getBOneValueTwo()); + bOneMap.put("threeValue", e.getBOneValueThree()); + bOneMap.put("fourValue", e.getBOneValueFour()); + bOneMap.put("fiveValue", e.getBOneValueFive()); + bOneMap.put("sixValue", e.getBOneValueSix()); + return bOneMap; + }).collect(Collectors.toList()); + repList.add(bOneList.get(0)); + //B2 + List> bTwoList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map bTwoMap = new HashMap<>(); + bTwoMap.put("checkPoint", s); + bTwoMap.put("project", "B2(" + "Ιᵣ₂ᵢ)"); + bTwoMap.put("unit", e.getUnit()); + bTwoMap.put("oneValue", e.getBTwoValueOne()); + bTwoMap.put("twoValue", e.getBTwoValueTwo()); + bTwoMap.put("threeValue", e.getBTwoValueThree()); + bTwoMap.put("fourValue", e.getBTwoValueFour()); + bTwoMap.put("fiveValue", e.getBTwoValueFive()); + bTwoMap.put("sixValue", e.getBTwoValueSix()); + return bTwoMap; + }).collect(Collectors.toList()); + repList.add(bTwoList.get(0)); + //A2 + List> aTwoList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map aTwoMap = new HashMap<>(); + aTwoMap.put("checkPoint", s); + aTwoMap.put("project", "A2(" + "Ιᵣ₂ᵢ)"); + aTwoMap.put("unit", e.getUnit()); + aTwoMap.put("oneValue", e.getATwoValueOne()); + aTwoMap.put("twoValue", e.getATwoValueTwo()); + aTwoMap.put("threeValue", e.getATwoValueThree()); + aTwoMap.put("fourValue", e.getATwoValueFour()); + aTwoMap.put("fiveValue", e.getATwoValueFive()); + aTwoMap.put("sixValue", e.getATwoValueSix()); + return aTwoMap; + }).collect(Collectors.toList()); + repList.add(aTwoList.get(0)); + //Δi + List> deltaIotaList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map deltaIotaMap = new HashMap<>(); + deltaIotaMap.put("checkPoint", s); + deltaIotaMap.put("project", "Δ" + "Ιᵢ"); + deltaIotaMap.put("unit", e.getUnit()); + deltaIotaMap.put("oneValue", e.getAverageValueOne()); + deltaIotaMap.put("twoValue", e.getAverageValueTwo()); + deltaIotaMap.put("threeValue", e.getAverageValueThree()); + deltaIotaMap.put("fourValue", e.getAverageValueFour()); + deltaIotaMap.put("fiveValue", e.getAverageValueFive()); + deltaIotaMap.put("sixValue", e.getAverageValueSix()); + return deltaIotaMap; + }).collect(Collectors.toList()); + repList.add(deltaIotaList.get(0)); + // Δj + List> deltajList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map deltajMap = new HashMap<>(); + deltajMap.put("checkPoint", s); + deltajMap.put("project", "Δ" + "Ιʲ"); + deltajMap.put("unit", e.getUnit()); + deltajMap.put("oneValue", e.getAverageValue()); + deltajMap.put("twoValue", e.getAverageValue()); + deltajMap.put("threeValue", e.getAverageValue()); + deltajMap.put("fourValue", e.getAverageValue()); + deltajMap.put("fiveValue", e.getAverageValue()); + deltajMap.put("sixValue", e.getAverageValue()); + return deltajMap; + }).collect(Collectors.toList()); + repList.add(deltajList.get(0)); + //Sn + List> snList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map snMap = new HashMap<>(); + snMap.put("checkPoint", s); + snMap.put("project", "Sn"); + snMap.put("unit", e.getUnit()); + snMap.put("oneValue", e.getAverageValue()); + snMap.put("twoValue", e.getAverageValue()); + snMap.put("threeValue", e.getAverageValue()); + snMap.put("fourValue", e.getAverageValue()); + snMap.put("fiveValue", e.getAverageValue()); + snMap.put("sixValue", e.getAverageValue()); + return snMap; + }).collect(Collectors.toList()); + repList.add(snList.get(0)); + map.put("repList", repList); + } + + List staList = eTwoList + .stream().filter(e -> STABILITY.equals(e.getCheckType()) + && (StringUtils.isNotEmpty(e.getTestValueOneDate()) + || StringUtils.isNotEmpty(e.getTestValueTwoDate()) + || StringUtils.isNotEmpty(e.getTestValueThreeDate()) + || StringUtils.isNotEmpty(e.getTestValueFourDate()) + || StringUtils.isNotEmpty(e.getTestValueFiveDate()) + || StringUtils.isNotEmpty(e.getTestValueSixDate())) + ).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(staList)) { + statisticalDate(staList, STA_PREFIX, map); + List repMapList = new ArrayList<>(); + for (BizEquipmentStandardCheckDataETwo sta : staList) { + Map repMap = BeanUtil.beanToMap(sta); + repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); + repMapList.add(repMap); + } + map.put("staList", repMapList); + } + } + + /** * 组装参数 * * @param sta diff --git a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ResistanceThermometerHandler.java b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ResistanceThermometerHandler.java index e59adc6..048a955 100644 --- a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ResistanceThermometerHandler.java +++ b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ResistanceThermometerHandler.java @@ -98,12 +98,20 @@ List lowerStaList = staTreeMap.get(staTreeMap.firstKey()); BizEquipmentStandardCheckDataResistanceThermometer lowerSta = lowerStaList.get(0); - lowerSta.setConclusion(lowerSta.getLessThan() == 0 ? "否" : "是"); + if (lowerSta.getLessThan() == null) { + lowerSta.setConclusion(""); + } else { + lowerSta.setConclusion(lowerSta.getLessThan() == 0 ? "否" : "是"); + } map.put("lowerSta", lowerSta); List upperStaList = staTreeMap.get(staTreeMap.lastKey()); BizEquipmentStandardCheckDataResistanceThermometer upperSta = upperStaList.get(0); - upperSta.setConclusion(upperSta.getLessThan() == 0 ? "否" : "是"); + if (upperSta.getLessThan() == null) { + upperSta.setConclusion(""); + } else { + upperSta.setConclusion(upperSta.getLessThan() == 0 ? "否" : "是"); + } map.put("upperSta", upperSta); //RTP值重复性 List rtpRepList = thermometerList.stream() @@ -263,11 +271,11 @@ .sorted(Comparator.reverseOrder()) .collect(Collectors.toList()); String maxVolatility = null; - if (!CollectionUtils.isEmpty(volList)){ + if (!CollectionUtils.isEmpty(volList)) { maxVolatility = volList.get(0); } - map.put("maxVolatility",maxVolatility); + map.put("maxVolatility", maxVolatility); //均匀性测试 TreeMap> uniformityTreeMap = resistanceThermometerList.stream().filter(t -> "2".equals(t.getDataType())).collect(Collectors.groupingBy(BizBusinessDeviceMeasureDataResistanceThermometer::getUpperLowerPoint, TreeMap::new, Collectors.toList())); String uniFirstKey = uniformityTreeMap.firstKey(); @@ -296,10 +304,10 @@ .map(BizBusinessDeviceMeasureDataResistanceThermometer::getMaxWorkTemperatureDifferent) .collect(Collectors.toList()); String maxWorkTemperatureDifferent = null; - if (!CollectionUtils.isEmpty(maxDifferentList)){ + if (!CollectionUtils.isEmpty(maxDifferentList)) { maxWorkTemperatureDifferent = maxDifferentList.get(0); } - map.put("maxWorkTemperatureDifferent",maxWorkTemperatureDifferent); + map.put("maxWorkTemperatureDifferent", maxWorkTemperatureDifferent); } diff --git a/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml b/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml index 42c5b56..526e278 100644 --- a/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml +++ b/casic-metering-dao/src/main/resources/mapper/business/BizBusinessDeviceMeasureEquipmentMapper.xml @@ -15,12 +15,16 @@ id, data_id, equipment_id, create_time, update_time - + + + + diff --git a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java index 21d48ff..afc322a 100644 --- a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java +++ b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/DcPowerSupplyHandler.java @@ -70,6 +70,7 @@ for (int i = 0; i < pointList.size(); i++) { String points = pointList.get(i); + //重复性 List repList = request.getCheckDataDcPowerList() .stream().filter(e -> points.equals(e.getCheckParam()) && checkTypes[0].equals(e.getCheckType()) @@ -82,7 +83,7 @@ } map.put(REPEAT_PREFIX + (i + 1), repMapList); } - + //稳定性 List staList = request.getCheckDataDcPowerList() .stream().filter(e -> points.equals(e.getCheckParam()) && checkTypes[1].equals(e.getCheckType()) @@ -98,7 +99,11 @@ List repMapList = new ArrayList<>(); for (BizEquipmentStandardCheckDataDcPower sta : staList) { Map repMap = BeanUtil.beanToMap(sta); - repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); + if (sta.getLessThan() != null) { + repMap.put("lessThan", 0 == sta.getLessThan() ? "否" : "是"); + }else { + repMap.put("lessThan",""); + } repMapList.add(repMap); } map.put(STA_PREFIX + (i + 1) + UP_STANDARD, "\uF0A3"); @@ -125,21 +130,25 @@ map.put(REPEAT_PREFIX + 5, repMapList); } - // || StringUtils.isNotEmpty(d.getTestValueOneDate()) - // || StringUtils.isNotEmpty(d.getTestValueTwoDate()) - // || StringUtils.isNotEmpty(d.getTestValueThreeDate()) - // || StringUtils.isNotEmpty(d.getTestValueFourDate()) - // || StringUtils.isNotEmpty(d.getTestValueFiveDate()) - // || StringUtils.isNotEmpty(d.getTestValueSixDate()) List staList = request.getCheckDataDcPowerList().stream() .filter(d -> RIPPLE_VOLTAGE.equals(d.getCheckParam()) - && checkTypes[1].equals(d.getCheckType())).collect(Collectors.toList()); + && checkTypes[1].equals(d.getCheckType()) + && (StringUtils.isNotEmpty(d.getTestValueOneDate()) + || StringUtils.isNotEmpty(d.getTestValueTwoDate()) + || StringUtils.isNotEmpty(d.getTestValueThreeDate()) + || StringUtils.isNotEmpty(d.getTestValueFourDate()) + || StringUtils.isNotEmpty(d.getTestValueFiveDate()) + || StringUtils.isNotEmpty(d.getTestValueSixDate()))).collect(Collectors.toList()); if (!CollectionUtils.isEmpty(staList)) { statisticalDate(staList, STA_PREFIX + 5, map); List repMapList = new ArrayList<>(); for (BizEquipmentStandardCheckDataDcPower sta : staList) { Map repMap = BeanUtil.beanToMap(sta); - repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); + if (sta.getLessThan() != null) { + repMap.put("lessThan", 0 == sta.getLessThan() ? "否" : "是"); + }else { + repMap.put("lessThan",""); + } repMapList.add(repMap); } map.put(STA_PREFIX + 5 + UP_STANDARD, "\uF0A3"); @@ -255,12 +264,20 @@ //波纹电压 List rippleList = dcPowerList.stream() .filter(dcPower -> "6".equals(dcPower.getDataType())).map(dcPower -> { - dcPower.setTechnicalIndex(dcPower.getTechnicalIndexSymbol() + dcPower.getTechnicalIndex() + "mV"); + dcPower.setTechnicalIndex(dcPower.getTechnicalIndexSymbol() + dcPower.getTechnicalIndex() + "%"); dcPower.setRippleVoltage(dcPower.getRippleVoltage() + "mV"); return dcPower; }).collect(Collectors.toList()); + //输出电压短期稳定性 + List shortRepList = dcPowerList.stream() + .filter(dcPower -> "7".equals(dcPower.getDataType())) + .peek(dcPower -> { + dcPower.setTechnicalIndex(dcPower.getTechnicalIndexSymbol() + dcPower.getTechnicalIndex() + "%"); + dcPower.setShortTermStability(dcPower.getShortTermStability() + "%"); + }).collect(Collectors.toList()); + map.put("shortRepList", shortRepList); map.put("powerSupplyVoltageAdjustmentList", powerSupplyVoltageAdjustmentList); map.put("loadRegulationList", loadRegulationList); map.put("voltageRepresentationErrorList", voltageRepresentationErrorList); @@ -353,7 +370,7 @@ } map.put("equipmentList", equipmentList); List dcPowerList = request.getMeasureDataDcPowerList(); - + //电源电压调整率 List powerSupplyVoltageAdjustmentList = dcPowerList.stream() .filter(dcPower -> "1".equals(dcPower.getDataType())).collect(Collectors.toList()); @@ -378,6 +395,9 @@ List rippleList = dcPowerList.stream() .filter(dcPower -> "6".equals(dcPower.getDataType())).collect(Collectors.toList()); + //输出电压短期稳定性 + List shortRepList = dcPowerList.stream() + .filter(dcPower -> "7".equals(dcPower.getDataType())).collect(Collectors.toList()); map.put("powerSupplyVoltageAdjustmentList", powerSupplyVoltageAdjustmentList); map.put("loadRegulationList", loadRegulationList); @@ -385,6 +405,7 @@ map.put("directMeasurementList", directMeasurementList); map.put("indirectMeasurementList", indirectMeasurementList); map.put("rippleList", rippleList); + map.put("shortRepList", shortRepList); prepareCoverParams(map, request.getLabCode()); List customTemplateUrls = new ArrayList<>(); diff --git a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ETwoWeightHandler.java b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ETwoWeightHandler.java index 95eb149..c5ac4e4 100644 --- a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ETwoWeightHandler.java +++ b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ETwoWeightHandler.java @@ -80,149 +80,9 @@ Map map = BeanUtil.beanToMap(request); List eTwoList = request.getCheckDataETwoList(); - List checkPointList = eTwoList.stream() - .map(BizEquipmentStandardCheckDataETwo::getCheckPoint) - .distinct() - .collect(Collectors.toList()); - List> repList = new ArrayList<>(); - for (String s : checkPointList) { - List> aOneList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map aOneMap = new HashMap<>(); - aOneMap.put("checkPoint", s); - aOneMap.put("project", "A1(" + "Ιᵣ₁ᵢ)"); - aOneMap.put("unit", e.getUnit()); - aOneMap.put("oneValue", e.getAOneValueOne()); - aOneMap.put("twoValue", e.getAOneValueTwo()); - aOneMap.put("threeValue", e.getAOneValueThree()); - aOneMap.put("fourValue", e.getAOneValueFour()); - aOneMap.put("fiveValue", e.getAOneValueFive()); - aOneMap.put("sixValue", e.getAOneValueSix()); - return aOneMap; - }) - .collect(Collectors.toList()); - repList.add(aOneList.get(0)); - List> bOneList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map bOneMap = new HashMap<>(); - bOneMap.put("checkPoint", s); - bOneMap.put("project", "B1(" + "Ιᵣ₁ᵢ)"); - bOneMap.put("unit", e.getUnit()); - bOneMap.put("oneValue", e.getBOneValueOne()); - bOneMap.put("twoValue", e.getBOneValueTwo()); - bOneMap.put("threeValue", e.getBOneValueThree()); - bOneMap.put("fourValue", e.getBOneValueFour()); - bOneMap.put("fiveValue", e.getBOneValueFive()); - bOneMap.put("sixValue", e.getBOneValueSix()); - return bOneMap; - }).collect(Collectors.toList()); - repList.add(bOneList.get(0)); - List> bTwoList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map bTwoMap = new HashMap<>(); - bTwoMap.put("checkPoint", s); - bTwoMap.put("project", "B2(" + "Ιᵣ₂ᵢ)"); - bTwoMap.put("unit", e.getUnit()); - bTwoMap.put("oneValue", e.getBTwoValueOne()); - bTwoMap.put("twoValue", e.getBTwoValueTwo()); - bTwoMap.put("threeValue", e.getBTwoValueThree()); - bTwoMap.put("fourValue", e.getBTwoValueFour()); - bTwoMap.put("fiveValue", e.getBTwoValueFive()); - bTwoMap.put("sixValue", e.getBTwoValueSix()); - return bTwoMap; - }).collect(Collectors.toList()); - repList.add(bTwoList.get(0)); - List> aTwoList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map aTwoMap = new HashMap<>(); - aTwoMap.put("checkPoint", s); - aTwoMap.put("project", "A2(" + "Ιᵣ₂ᵢ)"); - aTwoMap.put("unit", e.getUnit()); - aTwoMap.put("oneValue", e.getATwoValueOne()); - aTwoMap.put("twoValue", e.getATwoValueTwo()); - aTwoMap.put("threeValue", e.getATwoValueThree()); - aTwoMap.put("fourValue", e.getATwoValueFour()); - aTwoMap.put("fiveValue", e.getATwoValueFive()); - aTwoMap.put("sixValue", e.getATwoValueSix()); - return aTwoMap; - }).collect(Collectors.toList()); - repList.add(aTwoList.get(0)); - List> deltaIotaList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map deltaIotaMap = new HashMap<>(); - deltaIotaMap.put("checkPoint", s); - deltaIotaMap.put("project", "Δ" + "Ιᵢ"); - deltaIotaMap.put("unit", e.getUnit()); - deltaIotaMap.put("oneValue", e.getAverageValueOne()); - deltaIotaMap.put("twoValue", e.getAverageValueTwo()); - deltaIotaMap.put("threeValue", e.getAverageValueThree()); - deltaIotaMap.put("fourValue", e.getAverageValueFour()); - deltaIotaMap.put("fiveValue", e.getAverageValueFive()); - deltaIotaMap.put("sixValue", e.getAverageValueSix()); - return deltaIotaMap; - }).collect(Collectors.toList()); - repList.add(deltaIotaList.get(0)); - List> deltajList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map deltajMap = new HashMap<>(); - deltajMap.put("checkPoint", s); - deltajMap.put("project", "Δ" + "Ιʲ"); - deltajMap.put("unit", e.getUnit()); - deltajMap.put("oneValue", e.getAverageValue()); - deltajMap.put("twoValue", e.getAverageValue()); - deltajMap.put("threeValue", e.getAverageValue()); - deltajMap.put("fourValue", e.getAverageValue()); - deltajMap.put("fiveValue", e.getAverageValue()); - deltajMap.put("sixValue", e.getAverageValue()); - return deltajMap; - }).collect(Collectors.toList()); - repList.add(deltajList.get(0)); - List> snList = eTwoList.stream() - .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) - .map(e -> { - Map snMap = new HashMap<>(); - snMap.put("checkPoint", s); - snMap.put("project", "Sn"); - snMap.put("unit", e.getUnit()); - snMap.put("oneValue", e.getAverageValue()); - snMap.put("twoValue", e.getAverageValue()); - snMap.put("threeValue", e.getAverageValue()); - snMap.put("fourValue", e.getAverageValue()); - snMap.put("fiveValue", e.getAverageValue()); - snMap.put("sixValue", e.getAverageValue()); - return snMap; - }).collect(Collectors.toList()); - repList.add(snList.get(0)); - map.put("repList", repList); - } - - List staList = request.getCheckDataETwoList() - .stream().filter(e -> STABILITY.equals(e.getCheckType()) - && (StringUtils.isNotEmpty(e.getTestValueOneDate()) - || StringUtils.isNotEmpty(e.getTestValueTwoDate()) - || StringUtils.isNotEmpty(e.getTestValueThreeDate()) - || StringUtils.isNotEmpty(e.getTestValueFourDate()) - || StringUtils.isNotEmpty(e.getTestValueFiveDate()) - || StringUtils.isNotEmpty(e.getTestValueSixDate())) - ).collect(Collectors.toList()); - if (!CollectionUtils.isEmpty(staList)) { - statisticalDate(staList, STA_PREFIX, map); - List repMapList = new ArrayList<>(); - for (BizEquipmentStandardCheckDataETwo sta : staList) { - Map repMap = BeanUtil.beanToMap(sta); - repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); - repMapList.add(repMap); - } - map.put("staList", repMapList); - } + prepareCheckParams(eTwoList, map); //除了选用的模板不一致,模板配置流程是一致的 String wordUrl = printFileRegister.registerPrintFile(ETWO_WEIGHT_CHECK_DATA, "数据打印", null, map, false, null, null); @@ -241,6 +101,162 @@ } /** + * 核查填充参数 + * @param eTwoList + * @param map + */ + private void prepareCheckParams(List eTwoList, Map map) { + List checkPointList = eTwoList.stream() + .map(BizEquipmentStandardCheckDataETwo::getCheckPoint) + .distinct() + .collect(Collectors.toList()); + List> repList = new ArrayList<>(); + for (String s : checkPointList) { + //A1 + List> aOneList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map aOneMap = new HashMap<>(); + aOneMap.put("checkPoint", s); + aOneMap.put("project", "A1(" + "Ιᵣ₁ᵢ)"); + aOneMap.put("unit", e.getUnit()); + aOneMap.put("oneValue", e.getAOneValueOne()); + aOneMap.put("twoValue", e.getAOneValueTwo()); + aOneMap.put("threeValue", e.getAOneValueThree()); + aOneMap.put("fourValue", e.getAOneValueFour()); + aOneMap.put("fiveValue", e.getAOneValueFive()); + aOneMap.put("sixValue", e.getAOneValueSix()); + return aOneMap; + }) + .collect(Collectors.toList()); + repList.add(aOneList.get(0)); + //B1 + List> bOneList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map bOneMap = new HashMap<>(); + bOneMap.put("checkPoint", s); + bOneMap.put("project", "B1(" + "Ιᵣ₁ᵢ)"); + bOneMap.put("unit", e.getUnit()); + bOneMap.put("oneValue", e.getBOneValueOne()); + bOneMap.put("twoValue", e.getBOneValueTwo()); + bOneMap.put("threeValue", e.getBOneValueThree()); + bOneMap.put("fourValue", e.getBOneValueFour()); + bOneMap.put("fiveValue", e.getBOneValueFive()); + bOneMap.put("sixValue", e.getBOneValueSix()); + return bOneMap; + }).collect(Collectors.toList()); + repList.add(bOneList.get(0)); + //B2 + List> bTwoList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map bTwoMap = new HashMap<>(); + bTwoMap.put("checkPoint", s); + bTwoMap.put("project", "B2(" + "Ιᵣ₂ᵢ)"); + bTwoMap.put("unit", e.getUnit()); + bTwoMap.put("oneValue", e.getBTwoValueOne()); + bTwoMap.put("twoValue", e.getBTwoValueTwo()); + bTwoMap.put("threeValue", e.getBTwoValueThree()); + bTwoMap.put("fourValue", e.getBTwoValueFour()); + bTwoMap.put("fiveValue", e.getBTwoValueFive()); + bTwoMap.put("sixValue", e.getBTwoValueSix()); + return bTwoMap; + }).collect(Collectors.toList()); + repList.add(bTwoList.get(0)); + //A2 + List> aTwoList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map aTwoMap = new HashMap<>(); + aTwoMap.put("checkPoint", s); + aTwoMap.put("project", "A2(" + "Ιᵣ₂ᵢ)"); + aTwoMap.put("unit", e.getUnit()); + aTwoMap.put("oneValue", e.getATwoValueOne()); + aTwoMap.put("twoValue", e.getATwoValueTwo()); + aTwoMap.put("threeValue", e.getATwoValueThree()); + aTwoMap.put("fourValue", e.getATwoValueFour()); + aTwoMap.put("fiveValue", e.getATwoValueFive()); + aTwoMap.put("sixValue", e.getATwoValueSix()); + return aTwoMap; + }).collect(Collectors.toList()); + repList.add(aTwoList.get(0)); + //Δi + List> deltaIotaList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map deltaIotaMap = new HashMap<>(); + deltaIotaMap.put("checkPoint", s); + deltaIotaMap.put("project", "Δ" + "Ιᵢ"); + deltaIotaMap.put("unit", e.getUnit()); + deltaIotaMap.put("oneValue", e.getAverageValueOne()); + deltaIotaMap.put("twoValue", e.getAverageValueTwo()); + deltaIotaMap.put("threeValue", e.getAverageValueThree()); + deltaIotaMap.put("fourValue", e.getAverageValueFour()); + deltaIotaMap.put("fiveValue", e.getAverageValueFive()); + deltaIotaMap.put("sixValue", e.getAverageValueSix()); + return deltaIotaMap; + }).collect(Collectors.toList()); + repList.add(deltaIotaList.get(0)); + // Δj + List> deltajList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map deltajMap = new HashMap<>(); + deltajMap.put("checkPoint", s); + deltajMap.put("project", "Δ" + "Ιʲ"); + deltajMap.put("unit", e.getUnit()); + deltajMap.put("oneValue", e.getAverageValue()); + deltajMap.put("twoValue", e.getAverageValue()); + deltajMap.put("threeValue", e.getAverageValue()); + deltajMap.put("fourValue", e.getAverageValue()); + deltajMap.put("fiveValue", e.getAverageValue()); + deltajMap.put("sixValue", e.getAverageValue()); + return deltajMap; + }).collect(Collectors.toList()); + repList.add(deltajList.get(0)); + //Sn + List> snList = eTwoList.stream() + .filter(e -> REPEATABILITY.equals(e.getCheckType()) && s.equals(e.getCheckPoint())) + .map(e -> { + Map snMap = new HashMap<>(); + snMap.put("checkPoint", s); + snMap.put("project", "Sn"); + snMap.put("unit", e.getUnit()); + snMap.put("oneValue", e.getAverageValue()); + snMap.put("twoValue", e.getAverageValue()); + snMap.put("threeValue", e.getAverageValue()); + snMap.put("fourValue", e.getAverageValue()); + snMap.put("fiveValue", e.getAverageValue()); + snMap.put("sixValue", e.getAverageValue()); + return snMap; + }).collect(Collectors.toList()); + repList.add(snList.get(0)); + map.put("repList", repList); + } + + List staList = eTwoList + .stream().filter(e -> STABILITY.equals(e.getCheckType()) + && (StringUtils.isNotEmpty(e.getTestValueOneDate()) + || StringUtils.isNotEmpty(e.getTestValueTwoDate()) + || StringUtils.isNotEmpty(e.getTestValueThreeDate()) + || StringUtils.isNotEmpty(e.getTestValueFourDate()) + || StringUtils.isNotEmpty(e.getTestValueFiveDate()) + || StringUtils.isNotEmpty(e.getTestValueSixDate())) + ).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(staList)) { + statisticalDate(staList, STA_PREFIX, map); + List repMapList = new ArrayList<>(); + for (BizEquipmentStandardCheckDataETwo sta : staList) { + Map repMap = BeanUtil.beanToMap(sta); + repMap.put("lessThan", ObjectUtils.isEmpty(sta.getLessThan()) || 0 == sta.getLessThan() ? "否" : "是"); + repMapList.add(repMap); + } + map.put("staList", repMapList); + } + } + + /** * 组装参数 * * @param sta diff --git a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ResistanceThermometerHandler.java b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ResistanceThermometerHandler.java index e59adc6..048a955 100644 --- a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ResistanceThermometerHandler.java +++ b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/ResistanceThermometerHandler.java @@ -98,12 +98,20 @@ List lowerStaList = staTreeMap.get(staTreeMap.firstKey()); BizEquipmentStandardCheckDataResistanceThermometer lowerSta = lowerStaList.get(0); - lowerSta.setConclusion(lowerSta.getLessThan() == 0 ? "否" : "是"); + if (lowerSta.getLessThan() == null) { + lowerSta.setConclusion(""); + } else { + lowerSta.setConclusion(lowerSta.getLessThan() == 0 ? "否" : "是"); + } map.put("lowerSta", lowerSta); List upperStaList = staTreeMap.get(staTreeMap.lastKey()); BizEquipmentStandardCheckDataResistanceThermometer upperSta = upperStaList.get(0); - upperSta.setConclusion(upperSta.getLessThan() == 0 ? "否" : "是"); + if (upperSta.getLessThan() == null) { + upperSta.setConclusion(""); + } else { + upperSta.setConclusion(upperSta.getLessThan() == 0 ? "否" : "是"); + } map.put("upperSta", upperSta); //RTP值重复性 List rtpRepList = thermometerList.stream() @@ -263,11 +271,11 @@ .sorted(Comparator.reverseOrder()) .collect(Collectors.toList()); String maxVolatility = null; - if (!CollectionUtils.isEmpty(volList)){ + if (!CollectionUtils.isEmpty(volList)) { maxVolatility = volList.get(0); } - map.put("maxVolatility",maxVolatility); + map.put("maxVolatility", maxVolatility); //均匀性测试 TreeMap> uniformityTreeMap = resistanceThermometerList.stream().filter(t -> "2".equals(t.getDataType())).collect(Collectors.groupingBy(BizBusinessDeviceMeasureDataResistanceThermometer::getUpperLowerPoint, TreeMap::new, Collectors.toList())); String uniFirstKey = uniformityTreeMap.firstKey(); @@ -296,10 +304,10 @@ .map(BizBusinessDeviceMeasureDataResistanceThermometer::getMaxWorkTemperatureDifferent) .collect(Collectors.toList()); String maxWorkTemperatureDifferent = null; - if (!CollectionUtils.isEmpty(maxDifferentList)){ + if (!CollectionUtils.isEmpty(maxDifferentList)) { maxWorkTemperatureDifferent = maxDifferentList.get(0); } - map.put("maxWorkTemperatureDifferent",maxWorkTemperatureDifferent); + map.put("maxWorkTemperatureDifferent", maxWorkTemperatureDifferent); } diff --git a/casic-metering-service/src/main/java/com/casic/missiles/service/listeners/register/PrintFileRegister.java b/casic-metering-service/src/main/java/com/casic/missiles/service/listeners/register/PrintFileRegister.java index d720da7..f66635e 100644 --- a/casic-metering-service/src/main/java/com/casic/missiles/service/listeners/register/PrintFileRegister.java +++ b/casic-metering-service/src/main/java/com/casic/missiles/service/listeners/register/PrintFileRegister.java @@ -130,17 +130,17 @@ } catch (RuntimeException rex) { log.error("文件打印出现异常,打印参数信息为{},异常信息为{}", JSON.toJSON(filePrintRegister), rex); } finally { - if (ObjectUtils.isNotEmpty(registerParameters.getCompressParameter()) && registerParameters.getCompressParameter().getZip()) { - //转移文件 - fileMove(localFileDir + registerParameters.getCompressParameter().getRootDirName(), printDocUrl); - } else if (StringUtils.isNotEmpty(printDocUrl)) { - //如果文件路径不为空,回传文件流 - miniName = createResponseFileInput(printDocUrl, registerParameters.getResponse()); - } - //删除无效的文件 - File invalidFile = new File(tempLocalFileDir); - // 删除运行空间下的文件 - deleteFile(invalidFile); +// if (ObjectUtils.isNotEmpty(registerParameters.getCompressParameter()) && registerParameters.getCompressParameter().getZip()) { +// //转移文件 +// fileMove(localFileDir + registerParameters.getCompressParameter().getRootDirName(), printDocUrl); +// } else if (StringUtils.isNotEmpty(printDocUrl)) { +// //如果文件路径不为空,回传文件流 +// miniName = createResponseFileInput(printDocUrl, registerParameters.getResponse()); +// } +// //删除无效的文件 +// File invalidFile = new File(tempLocalFileDir); +// // 删除运行空间下的文件 +// deleteFile(invalidFile); log.info("证书打印完成......,证书名称为{}", miniName); } return miniName;