diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java index 39a037e..e6f4d11 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java @@ -36,6 +36,7 @@ String SPECTRUM_ANALYZER = "频谱分析仪"; String OSCILLOSCOPE = "示波器"; + String OSCILLOSCOPE_CHECK_DATA = "示波器核查记录"; String CESIUM_ATOMIC_FREQUENCY = "铯原子频率"; diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java index 39a037e..e6f4d11 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java @@ -36,6 +36,7 @@ String SPECTRUM_ANALYZER = "频谱分析仪"; String OSCILLOSCOPE = "示波器"; + String OSCILLOSCOPE_CHECK_DATA = "示波器核查记录"; String CESIUM_ATOMIC_FREQUENCY = "铯原子频率"; diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java index ba5cff0..4235710 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java @@ -316,14 +316,14 @@ String ANALOG_OSCILLOSCOPE = "模拟示波器"; - String HOUR_MARKERS = "1"; - String SQUARE_WAVE_VOLTAGE_50 = "2"; - String SQUARE_WAVE_VOLTAGE_1M = "3"; - String DC_VOLTAGE_50 = "4"; - String DC_VOLTAGE_1M = "5"; - String INPUT_IMPEDANCE = "6"; - String SINE_SIGNAL_FLATNESS = "7"; - String RISE_TIME_CHECK = "8"; + String HOUR_MARKERS = "时标"; + String SQUARE_WAVE_VOLTAGE_50 = "方波电压(50Ω)"; + String SQUARE_WAVE_VOLTAGE_1M = "方波电压(1MΩ)"; + String DC_VOLTAGE_50 = "直流电压(50Ω)"; + String DC_VOLTAGE_1M = "直流电压(1MΩ)"; + String INPUT_IMPEDANCE = "输入阻抗"; + String SINE_SIGNAL_FLATNESS = "稳幅正弦信号电压平坦度"; + String RISE_TIME_CHECK = "上升时间"; /** *

diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java index 39a037e..e6f4d11 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java @@ -36,6 +36,7 @@ String SPECTRUM_ANALYZER = "频谱分析仪"; String OSCILLOSCOPE = "示波器"; + String OSCILLOSCOPE_CHECK_DATA = "示波器核查记录"; String CESIUM_ATOMIC_FREQUENCY = "铯原子频率"; diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java index ba5cff0..4235710 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java @@ -316,14 +316,14 @@ String ANALOG_OSCILLOSCOPE = "模拟示波器"; - String HOUR_MARKERS = "1"; - String SQUARE_WAVE_VOLTAGE_50 = "2"; - String SQUARE_WAVE_VOLTAGE_1M = "3"; - String DC_VOLTAGE_50 = "4"; - String DC_VOLTAGE_1M = "5"; - String INPUT_IMPEDANCE = "6"; - String SINE_SIGNAL_FLATNESS = "7"; - String RISE_TIME_CHECK = "8"; + String HOUR_MARKERS = "时标"; + String SQUARE_WAVE_VOLTAGE_50 = "方波电压(50Ω)"; + String SQUARE_WAVE_VOLTAGE_1M = "方波电压(1MΩ)"; + String DC_VOLTAGE_50 = "直流电压(50Ω)"; + String DC_VOLTAGE_1M = "直流电压(1MΩ)"; + String INPUT_IMPEDANCE = "输入阻抗"; + String SINE_SIGNAL_FLATNESS = "稳幅正弦信号电压平坦度"; + String RISE_TIME_CHECK = "上升时间"; /** *

diff --git a/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java b/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java index f7dca44..b5960ee 100644 --- a/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java +++ b/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java @@ -32,4 +32,7 @@ @ApiModelProperty(value = "导出ids", dataType = "List") private List ids; + + @ApiModelProperty(value = "是否为Pdf",dataType = "boolean") + private boolean isPdf; } diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java index 39a037e..e6f4d11 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java @@ -36,6 +36,7 @@ String SPECTRUM_ANALYZER = "频谱分析仪"; String OSCILLOSCOPE = "示波器"; + String OSCILLOSCOPE_CHECK_DATA = "示波器核查记录"; String CESIUM_ATOMIC_FREQUENCY = "铯原子频率"; diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java index ba5cff0..4235710 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java @@ -316,14 +316,14 @@ String ANALOG_OSCILLOSCOPE = "模拟示波器"; - String HOUR_MARKERS = "1"; - String SQUARE_WAVE_VOLTAGE_50 = "2"; - String SQUARE_WAVE_VOLTAGE_1M = "3"; - String DC_VOLTAGE_50 = "4"; - String DC_VOLTAGE_1M = "5"; - String INPUT_IMPEDANCE = "6"; - String SINE_SIGNAL_FLATNESS = "7"; - String RISE_TIME_CHECK = "8"; + String HOUR_MARKERS = "时标"; + String SQUARE_WAVE_VOLTAGE_50 = "方波电压(50Ω)"; + String SQUARE_WAVE_VOLTAGE_1M = "方波电压(1MΩ)"; + String DC_VOLTAGE_50 = "直流电压(50Ω)"; + String DC_VOLTAGE_1M = "直流电压(1MΩ)"; + String INPUT_IMPEDANCE = "输入阻抗"; + String SINE_SIGNAL_FLATNESS = "稳幅正弦信号电压平坦度"; + String RISE_TIME_CHECK = "上升时间"; /** *

diff --git a/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java b/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java index f7dca44..b5960ee 100644 --- a/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java +++ b/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java @@ -32,4 +32,7 @@ @ApiModelProperty(value = "导出ids", dataType = "List") private List ids; + + @ApiModelProperty(value = "是否为Pdf",dataType = "boolean") + private boolean isPdf; } diff --git a/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java b/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java index 01a553e..63372cd 100644 --- a/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java +++ b/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java @@ -3,10 +3,14 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.casic.missiles.strategy.handler.impl.OscilloscopeStrategyType; +import com.casic.missiles.strategy.handler.impl.SignalGeneratorStrategyType; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; /** *

@@ -471,4 +475,42 @@ @TableField(exist = false) private String twoRelativeError; + public void applyStrategyBasedOnDataType(String type) { + //数字 + Map digitalMap = new HashMap<>(); + digitalMap.put("1", OscilloscopeStrategyType.TIME_BASE); + digitalMap.put("2", OscilloscopeStrategyType.RELATIVE_ERROR); + digitalMap.put("3", OscilloscopeStrategyType.ERROR); + digitalMap.put("4", OscilloscopeStrategyType.DECIBEL); + digitalMap.put("5", OscilloscopeStrategyType.MEASURE_VALUE); + digitalMap.put("6", OscilloscopeStrategyType.MEASURE_VALUE); + digitalMap.put("7", OscilloscopeStrategyType.RELATIVE_ERROR); + digitalMap.put("8", OscilloscopeStrategyType.DIGITAL_CALIBRATION_SIGNAL); + //模拟 + Map simulationMap = new HashMap<>(); + simulationMap.put("1", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("2", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("3", OscilloscopeStrategyType.MEASURE_VALUE); + simulationMap.put("4", OscilloscopeStrategyType.OUTPUT_SIGNAL); + simulationMap.put("5", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("6", OscilloscopeStrategyType.UP_TIME); + simulationMap.put("7", OscilloscopeStrategyType.CALIBRATION_SIGNAL); + OscilloscopeStrategyType oscilloscopeStrategyType = null; + switch (type) { + case "数字示波器": { + oscilloscopeStrategyType = digitalMap.get(dataType); + break; + } + case "模拟示波器": { + oscilloscopeStrategyType = simulationMap.get(dataType); + break; + } + default: { + throw new UnsupportedOperationException("不支持该示波器类型"); + } + } + if (oscilloscopeStrategyType != null) { + oscilloscopeStrategyType.appendAsterisksIfNeeded(this); + } + } } diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java index 39a037e..e6f4d11 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java @@ -36,6 +36,7 @@ String SPECTRUM_ANALYZER = "频谱分析仪"; String OSCILLOSCOPE = "示波器"; + String OSCILLOSCOPE_CHECK_DATA = "示波器核查记录"; String CESIUM_ATOMIC_FREQUENCY = "铯原子频率"; diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java index ba5cff0..4235710 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java @@ -316,14 +316,14 @@ String ANALOG_OSCILLOSCOPE = "模拟示波器"; - String HOUR_MARKERS = "1"; - String SQUARE_WAVE_VOLTAGE_50 = "2"; - String SQUARE_WAVE_VOLTAGE_1M = "3"; - String DC_VOLTAGE_50 = "4"; - String DC_VOLTAGE_1M = "5"; - String INPUT_IMPEDANCE = "6"; - String SINE_SIGNAL_FLATNESS = "7"; - String RISE_TIME_CHECK = "8"; + String HOUR_MARKERS = "时标"; + String SQUARE_WAVE_VOLTAGE_50 = "方波电压(50Ω)"; + String SQUARE_WAVE_VOLTAGE_1M = "方波电压(1MΩ)"; + String DC_VOLTAGE_50 = "直流电压(50Ω)"; + String DC_VOLTAGE_1M = "直流电压(1MΩ)"; + String INPUT_IMPEDANCE = "输入阻抗"; + String SINE_SIGNAL_FLATNESS = "稳幅正弦信号电压平坦度"; + String RISE_TIME_CHECK = "上升时间"; /** *

diff --git a/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java b/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java index f7dca44..b5960ee 100644 --- a/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java +++ b/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java @@ -32,4 +32,7 @@ @ApiModelProperty(value = "导出ids", dataType = "List") private List ids; + + @ApiModelProperty(value = "是否为Pdf",dataType = "boolean") + private boolean isPdf; } diff --git a/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java b/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java index 01a553e..63372cd 100644 --- a/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java +++ b/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java @@ -3,10 +3,14 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.casic.missiles.strategy.handler.impl.OscilloscopeStrategyType; +import com.casic.missiles.strategy.handler.impl.SignalGeneratorStrategyType; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; /** *

@@ -471,4 +475,42 @@ @TableField(exist = false) private String twoRelativeError; + public void applyStrategyBasedOnDataType(String type) { + //数字 + Map digitalMap = new HashMap<>(); + digitalMap.put("1", OscilloscopeStrategyType.TIME_BASE); + digitalMap.put("2", OscilloscopeStrategyType.RELATIVE_ERROR); + digitalMap.put("3", OscilloscopeStrategyType.ERROR); + digitalMap.put("4", OscilloscopeStrategyType.DECIBEL); + digitalMap.put("5", OscilloscopeStrategyType.MEASURE_VALUE); + digitalMap.put("6", OscilloscopeStrategyType.MEASURE_VALUE); + digitalMap.put("7", OscilloscopeStrategyType.RELATIVE_ERROR); + digitalMap.put("8", OscilloscopeStrategyType.DIGITAL_CALIBRATION_SIGNAL); + //模拟 + Map simulationMap = new HashMap<>(); + simulationMap.put("1", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("2", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("3", OscilloscopeStrategyType.MEASURE_VALUE); + simulationMap.put("4", OscilloscopeStrategyType.OUTPUT_SIGNAL); + simulationMap.put("5", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("6", OscilloscopeStrategyType.UP_TIME); + simulationMap.put("7", OscilloscopeStrategyType.CALIBRATION_SIGNAL); + OscilloscopeStrategyType oscilloscopeStrategyType = null; + switch (type) { + case "数字示波器": { + oscilloscopeStrategyType = digitalMap.get(dataType); + break; + } + case "模拟示波器": { + oscilloscopeStrategyType = simulationMap.get(dataType); + break; + } + default: { + throw new UnsupportedOperationException("不支持该示波器类型"); + } + } + if (oscilloscopeStrategyType != null) { + oscilloscopeStrategyType.appendAsterisksIfNeeded(this); + } + } } diff --git a/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/OscilloscopeStrategy.java b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/OscilloscopeStrategy.java new file mode 100644 index 0000000..534c2c1 --- /dev/null +++ b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/OscilloscopeStrategy.java @@ -0,0 +1,17 @@ +package com.casic.missiles.strategy.handler; + +import com.casic.missiles.model.business.BizBusinessDeviceMeasureDataOscilloscope; +import com.casic.missiles.model.business.BizBusinessDeviceMeasureDataResistanceThermometer; + +/** + * @Author: TuT + * @CreateTime: 2024-03-22 17:25 + * @Description: OscilloscopeStrategy + */ +public interface OscilloscopeStrategy { + /** + * + * @param oscilloscope + */ + void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope); +} diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java index 39a037e..e6f4d11 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java @@ -36,6 +36,7 @@ String SPECTRUM_ANALYZER = "频谱分析仪"; String OSCILLOSCOPE = "示波器"; + String OSCILLOSCOPE_CHECK_DATA = "示波器核查记录"; String CESIUM_ATOMIC_FREQUENCY = "铯原子频率"; diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java index ba5cff0..4235710 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java @@ -316,14 +316,14 @@ String ANALOG_OSCILLOSCOPE = "模拟示波器"; - String HOUR_MARKERS = "1"; - String SQUARE_WAVE_VOLTAGE_50 = "2"; - String SQUARE_WAVE_VOLTAGE_1M = "3"; - String DC_VOLTAGE_50 = "4"; - String DC_VOLTAGE_1M = "5"; - String INPUT_IMPEDANCE = "6"; - String SINE_SIGNAL_FLATNESS = "7"; - String RISE_TIME_CHECK = "8"; + String HOUR_MARKERS = "时标"; + String SQUARE_WAVE_VOLTAGE_50 = "方波电压(50Ω)"; + String SQUARE_WAVE_VOLTAGE_1M = "方波电压(1MΩ)"; + String DC_VOLTAGE_50 = "直流电压(50Ω)"; + String DC_VOLTAGE_1M = "直流电压(1MΩ)"; + String INPUT_IMPEDANCE = "输入阻抗"; + String SINE_SIGNAL_FLATNESS = "稳幅正弦信号电压平坦度"; + String RISE_TIME_CHECK = "上升时间"; /** *

diff --git a/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java b/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java index f7dca44..b5960ee 100644 --- a/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java +++ b/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java @@ -32,4 +32,7 @@ @ApiModelProperty(value = "导出ids", dataType = "List") private List ids; + + @ApiModelProperty(value = "是否为Pdf",dataType = "boolean") + private boolean isPdf; } diff --git a/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java b/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java index 01a553e..63372cd 100644 --- a/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java +++ b/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java @@ -3,10 +3,14 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.casic.missiles.strategy.handler.impl.OscilloscopeStrategyType; +import com.casic.missiles.strategy.handler.impl.SignalGeneratorStrategyType; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; /** *

@@ -471,4 +475,42 @@ @TableField(exist = false) private String twoRelativeError; + public void applyStrategyBasedOnDataType(String type) { + //数字 + Map digitalMap = new HashMap<>(); + digitalMap.put("1", OscilloscopeStrategyType.TIME_BASE); + digitalMap.put("2", OscilloscopeStrategyType.RELATIVE_ERROR); + digitalMap.put("3", OscilloscopeStrategyType.ERROR); + digitalMap.put("4", OscilloscopeStrategyType.DECIBEL); + digitalMap.put("5", OscilloscopeStrategyType.MEASURE_VALUE); + digitalMap.put("6", OscilloscopeStrategyType.MEASURE_VALUE); + digitalMap.put("7", OscilloscopeStrategyType.RELATIVE_ERROR); + digitalMap.put("8", OscilloscopeStrategyType.DIGITAL_CALIBRATION_SIGNAL); + //模拟 + Map simulationMap = new HashMap<>(); + simulationMap.put("1", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("2", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("3", OscilloscopeStrategyType.MEASURE_VALUE); + simulationMap.put("4", OscilloscopeStrategyType.OUTPUT_SIGNAL); + simulationMap.put("5", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("6", OscilloscopeStrategyType.UP_TIME); + simulationMap.put("7", OscilloscopeStrategyType.CALIBRATION_SIGNAL); + OscilloscopeStrategyType oscilloscopeStrategyType = null; + switch (type) { + case "数字示波器": { + oscilloscopeStrategyType = digitalMap.get(dataType); + break; + } + case "模拟示波器": { + oscilloscopeStrategyType = simulationMap.get(dataType); + break; + } + default: { + throw new UnsupportedOperationException("不支持该示波器类型"); + } + } + if (oscilloscopeStrategyType != null) { + oscilloscopeStrategyType.appendAsterisksIfNeeded(this); + } + } } diff --git a/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/OscilloscopeStrategy.java b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/OscilloscopeStrategy.java new file mode 100644 index 0000000..534c2c1 --- /dev/null +++ b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/OscilloscopeStrategy.java @@ -0,0 +1,17 @@ +package com.casic.missiles.strategy.handler; + +import com.casic.missiles.model.business.BizBusinessDeviceMeasureDataOscilloscope; +import com.casic.missiles.model.business.BizBusinessDeviceMeasureDataResistanceThermometer; + +/** + * @Author: TuT + * @CreateTime: 2024-03-22 17:25 + * @Description: OscilloscopeStrategy + */ +public interface OscilloscopeStrategy { + /** + * + * @param oscilloscope + */ + void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope); +} diff --git a/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/impl/OscilloscopeStrategyType.java b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/impl/OscilloscopeStrategyType.java new file mode 100644 index 0000000..6765273 --- /dev/null +++ b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/impl/OscilloscopeStrategyType.java @@ -0,0 +1,174 @@ +package com.casic.missiles.strategy.handler.impl; + +import com.casic.missiles.model.business.BizBusinessDeviceMeasureDataOscilloscope; +import com.casic.missiles.strategy.handler.OscilloscopeStrategy; +import org.apache.commons.lang3.StringUtils; + +/** + * @Author: TuT + * @CreateTime: 2024-03-22 17:26 + * @Description: OscilloscopeStrategyType + */ +public enum OscilloscopeStrategyType implements OscilloscopeStrategy { + /** + * 相对误差 + */ + RELATIVE_ERROR { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setHorizontalScaleGear(StringUtils.isNotBlank(oscilloscope.getHorizontalScaleGear()) ? oscilloscope.getHorizontalScaleGear() + oscilloscope.getHorizontalScaleGearUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + oscilloscope.setStandardValue(StringUtils.isNotBlank(oscilloscope.getStandardValue()) ? oscilloscope.getStandardValue() + oscilloscope.getStandardValueUnit() : ""); + oscilloscope.setMeasureValue(StringUtils.isNotBlank(oscilloscope.getMeasureValue()) ? oscilloscope.getMeasureValue() + oscilloscope.getMeasureValueUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getRelativeError())) { + oscilloscope.setRelativeError(oscilloscope.getRelativeError() + "*"); + } + } + }, + /** + * 测量值 + */ + MEASURE_VALUE { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + oscilloscope.setSignalFrequency(StringUtils.isNotBlank(oscilloscope.getSignalFrequency()) ? oscilloscope.getSignalFrequency() + oscilloscope.getSignalFrequencyUnit() : ""); + oscilloscope.setMeasureValue(StringUtils.isNotBlank(oscilloscope.getMeasureValue()) ? oscilloscope.getMeasureValue() + oscilloscope.getMeasureValueUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getMeasureValue())) { + oscilloscope.setMeasureValue(oscilloscope.getMeasureValue() + "*"); + } + } + }, + /** + * 输出信号幅度 + */ + OUTPUT_SIGNAL { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setFrequencyUpper(StringUtils.isNotBlank(oscilloscope.getFrequencyUpper()) ? oscilloscope.getFrequencyUpper() + oscilloscope.getFrequencyUpperUnit() : ""); + oscilloscope.setOutputSignalAmplitude(StringUtils.isNotBlank(oscilloscope.getOutputSignalAmplitude()) ? oscilloscope.getOutputSignalAmplitude() + oscilloscope.getTechnicalIndexUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + } + }, + /** + * 上升时间 + */ + UP_TIME { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getCorrectRiseTime())) { + oscilloscope.setCorrectRiseTime(oscilloscope.getCorrectRiseTime() + "*"); + } + } + }, + /** + * 校准信号 + */ + CALIBRATION_SIGNAL { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getAmplitudeDeviation())) { + oscilloscope.setAmplitudeDeviation(oscilloscope.getAmplitudeDeviation() + "*"); + } + if (oscilloscope.getExceedMarkOne() == 1 && StringUtils.isNotBlank(oscilloscope.getFrequencyDeviation())) { + oscilloscope.setFrequencyDeviation(oscilloscope.getFrequencyDeviation() + "*"); + } + } + }, + /** + * 时基 + */ + TIME_BASE { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setCycleSignal(StringUtils.isNotBlank(oscilloscope.getCycleSignal()) ? oscilloscope.getCycleSignal() + oscilloscope.getCycleSignalUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getTimeBaseRelativeError())) { + oscilloscope.setTimeBaseRelativeError(oscilloscope.getTimeBaseRelativeError() + "*"); + } + } + }, + /** + * 误差 + */ + ERROR { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + oscilloscope.setStandardValue(StringUtils.isNotBlank(oscilloscope.getStandardValue()) ? oscilloscope.getStandardValue() + oscilloscope.getStandardValueUnit() : ""); + oscilloscope.setMeasureValue(StringUtils.isNotBlank(oscilloscope.getMeasureValue()) ? oscilloscope.getMeasureValue() + oscilloscope.getMeasureValueUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + if (oscilloscope.getExceedMark() == 1) { + oscilloscope.setErrorValue(oscilloscope.getErrorValue() + "*"); + } + } + }, + /** + * 分贝数 + */ + DECIBEL { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + oscilloscope.setReferenceAmplitude(StringUtils.isNotBlank(oscilloscope.getReferenceAmplitude()) ? oscilloscope.getReferenceAmplitude() + oscilloscope.getReferenceAmplitudeUnit() : ""); + oscilloscope.setMeasureAmplitude(StringUtils.isNotBlank(oscilloscope.getMeasureAmplitude()) ? oscilloscope.getMeasureAmplitude() + oscilloscope.getMeasureAmplitudeUnit() : ""); + oscilloscope.setDecibelNumber(StringUtils.isNotBlank(oscilloscope.getDecibelNumber()) ? oscilloscope.getDecibelNumber() + "dB" : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getDecibelNumber())) { + oscilloscope.setDecibelNumber(oscilloscope.getDecibelNumber() + "*"); + } + } + }, + /** + * 数字校准信号 + */ + DIGITAL_CALIBRATION_SIGNAL { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setNominalValue(StringUtils.isNotBlank(oscilloscope.getNominalValue()) ? oscilloscope.getNominalValue() + oscilloscope.getNominalValueUnit() : ""); + oscilloscope.setTopMeasureValue(StringUtils.isNotBlank(oscilloscope.getTopMeasureValue()) ? oscilloscope.getTopMeasureValue() + oscilloscope.getTopMeasureValueUnit() : ""); + oscilloscope.setBottomMeasureValue(StringUtils.isNotBlank(oscilloscope.getBottomMeasureValue()) ? oscilloscope.getBottomMeasureValue() + oscilloscope.getBottomMeasureValueUnit() : ""); + oscilloscope.setMeasureValue(StringUtils.isNotBlank(oscilloscope.getMeasureValue()) ? oscilloscope.getMeasureValue() + oscilloscope.getMeasureValueUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + } + }, +} diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java index 39a037e..e6f4d11 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java @@ -36,6 +36,7 @@ String SPECTRUM_ANALYZER = "频谱分析仪"; String OSCILLOSCOPE = "示波器"; + String OSCILLOSCOPE_CHECK_DATA = "示波器核查记录"; String CESIUM_ATOMIC_FREQUENCY = "铯原子频率"; diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java index ba5cff0..4235710 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java @@ -316,14 +316,14 @@ String ANALOG_OSCILLOSCOPE = "模拟示波器"; - String HOUR_MARKERS = "1"; - String SQUARE_WAVE_VOLTAGE_50 = "2"; - String SQUARE_WAVE_VOLTAGE_1M = "3"; - String DC_VOLTAGE_50 = "4"; - String DC_VOLTAGE_1M = "5"; - String INPUT_IMPEDANCE = "6"; - String SINE_SIGNAL_FLATNESS = "7"; - String RISE_TIME_CHECK = "8"; + String HOUR_MARKERS = "时标"; + String SQUARE_WAVE_VOLTAGE_50 = "方波电压(50Ω)"; + String SQUARE_WAVE_VOLTAGE_1M = "方波电压(1MΩ)"; + String DC_VOLTAGE_50 = "直流电压(50Ω)"; + String DC_VOLTAGE_1M = "直流电压(1MΩ)"; + String INPUT_IMPEDANCE = "输入阻抗"; + String SINE_SIGNAL_FLATNESS = "稳幅正弦信号电压平坦度"; + String RISE_TIME_CHECK = "上升时间"; /** *

diff --git a/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java b/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java index f7dca44..b5960ee 100644 --- a/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java +++ b/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java @@ -32,4 +32,7 @@ @ApiModelProperty(value = "导出ids", dataType = "List") private List ids; + + @ApiModelProperty(value = "是否为Pdf",dataType = "boolean") + private boolean isPdf; } diff --git a/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java b/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java index 01a553e..63372cd 100644 --- a/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java +++ b/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java @@ -3,10 +3,14 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.casic.missiles.strategy.handler.impl.OscilloscopeStrategyType; +import com.casic.missiles.strategy.handler.impl.SignalGeneratorStrategyType; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; /** *

@@ -471,4 +475,42 @@ @TableField(exist = false) private String twoRelativeError; + public void applyStrategyBasedOnDataType(String type) { + //数字 + Map digitalMap = new HashMap<>(); + digitalMap.put("1", OscilloscopeStrategyType.TIME_BASE); + digitalMap.put("2", OscilloscopeStrategyType.RELATIVE_ERROR); + digitalMap.put("3", OscilloscopeStrategyType.ERROR); + digitalMap.put("4", OscilloscopeStrategyType.DECIBEL); + digitalMap.put("5", OscilloscopeStrategyType.MEASURE_VALUE); + digitalMap.put("6", OscilloscopeStrategyType.MEASURE_VALUE); + digitalMap.put("7", OscilloscopeStrategyType.RELATIVE_ERROR); + digitalMap.put("8", OscilloscopeStrategyType.DIGITAL_CALIBRATION_SIGNAL); + //模拟 + Map simulationMap = new HashMap<>(); + simulationMap.put("1", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("2", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("3", OscilloscopeStrategyType.MEASURE_VALUE); + simulationMap.put("4", OscilloscopeStrategyType.OUTPUT_SIGNAL); + simulationMap.put("5", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("6", OscilloscopeStrategyType.UP_TIME); + simulationMap.put("7", OscilloscopeStrategyType.CALIBRATION_SIGNAL); + OscilloscopeStrategyType oscilloscopeStrategyType = null; + switch (type) { + case "数字示波器": { + oscilloscopeStrategyType = digitalMap.get(dataType); + break; + } + case "模拟示波器": { + oscilloscopeStrategyType = simulationMap.get(dataType); + break; + } + default: { + throw new UnsupportedOperationException("不支持该示波器类型"); + } + } + if (oscilloscopeStrategyType != null) { + oscilloscopeStrategyType.appendAsterisksIfNeeded(this); + } + } } diff --git a/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/OscilloscopeStrategy.java b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/OscilloscopeStrategy.java new file mode 100644 index 0000000..534c2c1 --- /dev/null +++ b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/OscilloscopeStrategy.java @@ -0,0 +1,17 @@ +package com.casic.missiles.strategy.handler; + +import com.casic.missiles.model.business.BizBusinessDeviceMeasureDataOscilloscope; +import com.casic.missiles.model.business.BizBusinessDeviceMeasureDataResistanceThermometer; + +/** + * @Author: TuT + * @CreateTime: 2024-03-22 17:25 + * @Description: OscilloscopeStrategy + */ +public interface OscilloscopeStrategy { + /** + * + * @param oscilloscope + */ + void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope); +} diff --git a/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/impl/OscilloscopeStrategyType.java b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/impl/OscilloscopeStrategyType.java new file mode 100644 index 0000000..6765273 --- /dev/null +++ b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/impl/OscilloscopeStrategyType.java @@ -0,0 +1,174 @@ +package com.casic.missiles.strategy.handler.impl; + +import com.casic.missiles.model.business.BizBusinessDeviceMeasureDataOscilloscope; +import com.casic.missiles.strategy.handler.OscilloscopeStrategy; +import org.apache.commons.lang3.StringUtils; + +/** + * @Author: TuT + * @CreateTime: 2024-03-22 17:26 + * @Description: OscilloscopeStrategyType + */ +public enum OscilloscopeStrategyType implements OscilloscopeStrategy { + /** + * 相对误差 + */ + RELATIVE_ERROR { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setHorizontalScaleGear(StringUtils.isNotBlank(oscilloscope.getHorizontalScaleGear()) ? oscilloscope.getHorizontalScaleGear() + oscilloscope.getHorizontalScaleGearUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + oscilloscope.setStandardValue(StringUtils.isNotBlank(oscilloscope.getStandardValue()) ? oscilloscope.getStandardValue() + oscilloscope.getStandardValueUnit() : ""); + oscilloscope.setMeasureValue(StringUtils.isNotBlank(oscilloscope.getMeasureValue()) ? oscilloscope.getMeasureValue() + oscilloscope.getMeasureValueUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getRelativeError())) { + oscilloscope.setRelativeError(oscilloscope.getRelativeError() + "*"); + } + } + }, + /** + * 测量值 + */ + MEASURE_VALUE { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + oscilloscope.setSignalFrequency(StringUtils.isNotBlank(oscilloscope.getSignalFrequency()) ? oscilloscope.getSignalFrequency() + oscilloscope.getSignalFrequencyUnit() : ""); + oscilloscope.setMeasureValue(StringUtils.isNotBlank(oscilloscope.getMeasureValue()) ? oscilloscope.getMeasureValue() + oscilloscope.getMeasureValueUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getMeasureValue())) { + oscilloscope.setMeasureValue(oscilloscope.getMeasureValue() + "*"); + } + } + }, + /** + * 输出信号幅度 + */ + OUTPUT_SIGNAL { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setFrequencyUpper(StringUtils.isNotBlank(oscilloscope.getFrequencyUpper()) ? oscilloscope.getFrequencyUpper() + oscilloscope.getFrequencyUpperUnit() : ""); + oscilloscope.setOutputSignalAmplitude(StringUtils.isNotBlank(oscilloscope.getOutputSignalAmplitude()) ? oscilloscope.getOutputSignalAmplitude() + oscilloscope.getTechnicalIndexUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + } + }, + /** + * 上升时间 + */ + UP_TIME { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getCorrectRiseTime())) { + oscilloscope.setCorrectRiseTime(oscilloscope.getCorrectRiseTime() + "*"); + } + } + }, + /** + * 校准信号 + */ + CALIBRATION_SIGNAL { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getAmplitudeDeviation())) { + oscilloscope.setAmplitudeDeviation(oscilloscope.getAmplitudeDeviation() + "*"); + } + if (oscilloscope.getExceedMarkOne() == 1 && StringUtils.isNotBlank(oscilloscope.getFrequencyDeviation())) { + oscilloscope.setFrequencyDeviation(oscilloscope.getFrequencyDeviation() + "*"); + } + } + }, + /** + * 时基 + */ + TIME_BASE { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setCycleSignal(StringUtils.isNotBlank(oscilloscope.getCycleSignal()) ? oscilloscope.getCycleSignal() + oscilloscope.getCycleSignalUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getTimeBaseRelativeError())) { + oscilloscope.setTimeBaseRelativeError(oscilloscope.getTimeBaseRelativeError() + "*"); + } + } + }, + /** + * 误差 + */ + ERROR { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + oscilloscope.setStandardValue(StringUtils.isNotBlank(oscilloscope.getStandardValue()) ? oscilloscope.getStandardValue() + oscilloscope.getStandardValueUnit() : ""); + oscilloscope.setMeasureValue(StringUtils.isNotBlank(oscilloscope.getMeasureValue()) ? oscilloscope.getMeasureValue() + oscilloscope.getMeasureValueUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + if (oscilloscope.getExceedMark() == 1) { + oscilloscope.setErrorValue(oscilloscope.getErrorValue() + "*"); + } + } + }, + /** + * 分贝数 + */ + DECIBEL { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + oscilloscope.setReferenceAmplitude(StringUtils.isNotBlank(oscilloscope.getReferenceAmplitude()) ? oscilloscope.getReferenceAmplitude() + oscilloscope.getReferenceAmplitudeUnit() : ""); + oscilloscope.setMeasureAmplitude(StringUtils.isNotBlank(oscilloscope.getMeasureAmplitude()) ? oscilloscope.getMeasureAmplitude() + oscilloscope.getMeasureAmplitudeUnit() : ""); + oscilloscope.setDecibelNumber(StringUtils.isNotBlank(oscilloscope.getDecibelNumber()) ? oscilloscope.getDecibelNumber() + "dB" : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getDecibelNumber())) { + oscilloscope.setDecibelNumber(oscilloscope.getDecibelNumber() + "*"); + } + } + }, + /** + * 数字校准信号 + */ + DIGITAL_CALIBRATION_SIGNAL { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setNominalValue(StringUtils.isNotBlank(oscilloscope.getNominalValue()) ? oscilloscope.getNominalValue() + oscilloscope.getNominalValueUnit() : ""); + oscilloscope.setTopMeasureValue(StringUtils.isNotBlank(oscilloscope.getTopMeasureValue()) ? oscilloscope.getTopMeasureValue() + oscilloscope.getTopMeasureValueUnit() : ""); + oscilloscope.setBottomMeasureValue(StringUtils.isNotBlank(oscilloscope.getBottomMeasureValue()) ? oscilloscope.getBottomMeasureValue() + oscilloscope.getBottomMeasureValueUnit() : ""); + oscilloscope.setMeasureValue(StringUtils.isNotBlank(oscilloscope.getMeasureValue()) ? oscilloscope.getMeasureValue() + oscilloscope.getMeasureValueUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + } + }, +} diff --git a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/business/BizBusinessOutsourcerInfoServiceImpl.java b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/business/BizBusinessOutsourcerInfoServiceImpl.java index 4ba26f8..2832dfa 100644 --- a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/business/BizBusinessOutsourcerInfoServiceImpl.java +++ b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/business/BizBusinessOutsourcerInfoServiceImpl.java @@ -30,6 +30,7 @@ import java.util.HashMap; import java.util.List; +import static com.casic.missiles.enums.PrintFileModuleNameEnum.EXPORT_TEMPLATE; import static com.casic.missiles.enums.PrintFileModuleNameEnum.OUTSOURCER; /** @@ -76,7 +77,7 @@ if (!CollectionUtils.isEmpty(outsourcerInfoList)){ HashMap map = new HashMap<>(); map.put("outsourcerList", outsourcerInfoList); - printFileRegister.registerPrintFile(OUTSOURCER, "1", null, map, true, response); + printFileRegister.registerPrintFile(OUTSOURCER, EXPORT_TEMPLATE, null, map, request.isPdf(), response); } } diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java index 39a037e..e6f4d11 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/PrintFileModuleNameEnum.java @@ -36,6 +36,7 @@ String SPECTRUM_ANALYZER = "频谱分析仪"; String OSCILLOSCOPE = "示波器"; + String OSCILLOSCOPE_CHECK_DATA = "示波器核查记录"; String CESIUM_ATOMIC_FREQUENCY = "铯原子频率"; diff --git a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java index ba5cff0..4235710 100644 --- a/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java +++ b/casic-metering-common/src/main/java/com/casic/missiles/enums/business/MeasureCategoryEnum.java @@ -316,14 +316,14 @@ String ANALOG_OSCILLOSCOPE = "模拟示波器"; - String HOUR_MARKERS = "1"; - String SQUARE_WAVE_VOLTAGE_50 = "2"; - String SQUARE_WAVE_VOLTAGE_1M = "3"; - String DC_VOLTAGE_50 = "4"; - String DC_VOLTAGE_1M = "5"; - String INPUT_IMPEDANCE = "6"; - String SINE_SIGNAL_FLATNESS = "7"; - String RISE_TIME_CHECK = "8"; + String HOUR_MARKERS = "时标"; + String SQUARE_WAVE_VOLTAGE_50 = "方波电压(50Ω)"; + String SQUARE_WAVE_VOLTAGE_1M = "方波电压(1MΩ)"; + String DC_VOLTAGE_50 = "直流电压(50Ω)"; + String DC_VOLTAGE_1M = "直流电压(1MΩ)"; + String INPUT_IMPEDANCE = "输入阻抗"; + String SINE_SIGNAL_FLATNESS = "稳幅正弦信号电压平坦度"; + String RISE_TIME_CHECK = "上升时间"; /** *

diff --git a/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java b/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java index f7dca44..b5960ee 100644 --- a/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java +++ b/casic-metering-model/src/main/java/com/casic/missiles/dto/business/outsource/OutsourcerInfoApprovalListRequest.java @@ -32,4 +32,7 @@ @ApiModelProperty(value = "导出ids", dataType = "List") private List ids; + + @ApiModelProperty(value = "是否为Pdf",dataType = "boolean") + private boolean isPdf; } diff --git a/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java b/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java index 01a553e..63372cd 100644 --- a/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java +++ b/casic-metering-model/src/main/java/com/casic/missiles/model/business/BizBusinessDeviceMeasureDataOscilloscope.java @@ -3,10 +3,14 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.casic.missiles.strategy.handler.impl.OscilloscopeStrategyType; +import com.casic.missiles.strategy.handler.impl.SignalGeneratorStrategyType; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; /** *

@@ -471,4 +475,42 @@ @TableField(exist = false) private String twoRelativeError; + public void applyStrategyBasedOnDataType(String type) { + //数字 + Map digitalMap = new HashMap<>(); + digitalMap.put("1", OscilloscopeStrategyType.TIME_BASE); + digitalMap.put("2", OscilloscopeStrategyType.RELATIVE_ERROR); + digitalMap.put("3", OscilloscopeStrategyType.ERROR); + digitalMap.put("4", OscilloscopeStrategyType.DECIBEL); + digitalMap.put("5", OscilloscopeStrategyType.MEASURE_VALUE); + digitalMap.put("6", OscilloscopeStrategyType.MEASURE_VALUE); + digitalMap.put("7", OscilloscopeStrategyType.RELATIVE_ERROR); + digitalMap.put("8", OscilloscopeStrategyType.DIGITAL_CALIBRATION_SIGNAL); + //模拟 + Map simulationMap = new HashMap<>(); + simulationMap.put("1", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("2", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("3", OscilloscopeStrategyType.MEASURE_VALUE); + simulationMap.put("4", OscilloscopeStrategyType.OUTPUT_SIGNAL); + simulationMap.put("5", OscilloscopeStrategyType.RELATIVE_ERROR); + simulationMap.put("6", OscilloscopeStrategyType.UP_TIME); + simulationMap.put("7", OscilloscopeStrategyType.CALIBRATION_SIGNAL); + OscilloscopeStrategyType oscilloscopeStrategyType = null; + switch (type) { + case "数字示波器": { + oscilloscopeStrategyType = digitalMap.get(dataType); + break; + } + case "模拟示波器": { + oscilloscopeStrategyType = simulationMap.get(dataType); + break; + } + default: { + throw new UnsupportedOperationException("不支持该示波器类型"); + } + } + if (oscilloscopeStrategyType != null) { + oscilloscopeStrategyType.appendAsterisksIfNeeded(this); + } + } } diff --git a/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/OscilloscopeStrategy.java b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/OscilloscopeStrategy.java new file mode 100644 index 0000000..534c2c1 --- /dev/null +++ b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/OscilloscopeStrategy.java @@ -0,0 +1,17 @@ +package com.casic.missiles.strategy.handler; + +import com.casic.missiles.model.business.BizBusinessDeviceMeasureDataOscilloscope; +import com.casic.missiles.model.business.BizBusinessDeviceMeasureDataResistanceThermometer; + +/** + * @Author: TuT + * @CreateTime: 2024-03-22 17:25 + * @Description: OscilloscopeStrategy + */ +public interface OscilloscopeStrategy { + /** + * + * @param oscilloscope + */ + void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope); +} diff --git a/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/impl/OscilloscopeStrategyType.java b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/impl/OscilloscopeStrategyType.java new file mode 100644 index 0000000..6765273 --- /dev/null +++ b/casic-metering-model/src/main/java/com/casic/missiles/strategy/handler/impl/OscilloscopeStrategyType.java @@ -0,0 +1,174 @@ +package com.casic.missiles.strategy.handler.impl; + +import com.casic.missiles.model.business.BizBusinessDeviceMeasureDataOscilloscope; +import com.casic.missiles.strategy.handler.OscilloscopeStrategy; +import org.apache.commons.lang3.StringUtils; + +/** + * @Author: TuT + * @CreateTime: 2024-03-22 17:26 + * @Description: OscilloscopeStrategyType + */ +public enum OscilloscopeStrategyType implements OscilloscopeStrategy { + /** + * 相对误差 + */ + RELATIVE_ERROR { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setHorizontalScaleGear(StringUtils.isNotBlank(oscilloscope.getHorizontalScaleGear()) ? oscilloscope.getHorizontalScaleGear() + oscilloscope.getHorizontalScaleGearUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + oscilloscope.setStandardValue(StringUtils.isNotBlank(oscilloscope.getStandardValue()) ? oscilloscope.getStandardValue() + oscilloscope.getStandardValueUnit() : ""); + oscilloscope.setMeasureValue(StringUtils.isNotBlank(oscilloscope.getMeasureValue()) ? oscilloscope.getMeasureValue() + oscilloscope.getMeasureValueUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getRelativeError())) { + oscilloscope.setRelativeError(oscilloscope.getRelativeError() + "*"); + } + } + }, + /** + * 测量值 + */ + MEASURE_VALUE { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + oscilloscope.setSignalFrequency(StringUtils.isNotBlank(oscilloscope.getSignalFrequency()) ? oscilloscope.getSignalFrequency() + oscilloscope.getSignalFrequencyUnit() : ""); + oscilloscope.setMeasureValue(StringUtils.isNotBlank(oscilloscope.getMeasureValue()) ? oscilloscope.getMeasureValue() + oscilloscope.getMeasureValueUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getMeasureValue())) { + oscilloscope.setMeasureValue(oscilloscope.getMeasureValue() + "*"); + } + } + }, + /** + * 输出信号幅度 + */ + OUTPUT_SIGNAL { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setFrequencyUpper(StringUtils.isNotBlank(oscilloscope.getFrequencyUpper()) ? oscilloscope.getFrequencyUpper() + oscilloscope.getFrequencyUpperUnit() : ""); + oscilloscope.setOutputSignalAmplitude(StringUtils.isNotBlank(oscilloscope.getOutputSignalAmplitude()) ? oscilloscope.getOutputSignalAmplitude() + oscilloscope.getTechnicalIndexUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + } + }, + /** + * 上升时间 + */ + UP_TIME { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getCorrectRiseTime())) { + oscilloscope.setCorrectRiseTime(oscilloscope.getCorrectRiseTime() + "*"); + } + } + }, + /** + * 校准信号 + */ + CALIBRATION_SIGNAL { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getAmplitudeDeviation())) { + oscilloscope.setAmplitudeDeviation(oscilloscope.getAmplitudeDeviation() + "*"); + } + if (oscilloscope.getExceedMarkOne() == 1 && StringUtils.isNotBlank(oscilloscope.getFrequencyDeviation())) { + oscilloscope.setFrequencyDeviation(oscilloscope.getFrequencyDeviation() + "*"); + } + } + }, + /** + * 时基 + */ + TIME_BASE { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setCycleSignal(StringUtils.isNotBlank(oscilloscope.getCycleSignal()) ? oscilloscope.getCycleSignal() + oscilloscope.getCycleSignalUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getTimeBaseRelativeError())) { + oscilloscope.setTimeBaseRelativeError(oscilloscope.getTimeBaseRelativeError() + "*"); + } + } + }, + /** + * 误差 + */ + ERROR { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + oscilloscope.setStandardValue(StringUtils.isNotBlank(oscilloscope.getStandardValue()) ? oscilloscope.getStandardValue() + oscilloscope.getStandardValueUnit() : ""); + oscilloscope.setMeasureValue(StringUtils.isNotBlank(oscilloscope.getMeasureValue()) ? oscilloscope.getMeasureValue() + oscilloscope.getMeasureValueUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + if (oscilloscope.getExceedMark() == 1) { + oscilloscope.setErrorValue(oscilloscope.getErrorValue() + "*"); + } + } + }, + /** + * 分贝数 + */ + DECIBEL { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setImpedance(StringUtils.isNotBlank(oscilloscope.getImpedance()) ? oscilloscope.getImpedance() + oscilloscope.getImpedanceUnit() : ""); + oscilloscope.setVerticalScaleGear(StringUtils.isNotBlank(oscilloscope.getVerticalScaleGear()) ? oscilloscope.getVerticalScaleGear() + oscilloscope.getVerticalScaleGearUnit() : ""); + oscilloscope.setReferenceAmplitude(StringUtils.isNotBlank(oscilloscope.getReferenceAmplitude()) ? oscilloscope.getReferenceAmplitude() + oscilloscope.getReferenceAmplitudeUnit() : ""); + oscilloscope.setMeasureAmplitude(StringUtils.isNotBlank(oscilloscope.getMeasureAmplitude()) ? oscilloscope.getMeasureAmplitude() + oscilloscope.getMeasureAmplitudeUnit() : ""); + oscilloscope.setDecibelNumber(StringUtils.isNotBlank(oscilloscope.getDecibelNumber()) ? oscilloscope.getDecibelNumber() + "dB" : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + if (oscilloscope.getExceedMark() == 1 && StringUtils.isNotBlank(oscilloscope.getDecibelNumber())) { + oscilloscope.setDecibelNumber(oscilloscope.getDecibelNumber() + "*"); + } + } + }, + /** + * 数字校准信号 + */ + DIGITAL_CALIBRATION_SIGNAL { + /** + * @param oscilloscope + */ + @Override + public void appendAsterisksIfNeeded(BizBusinessDeviceMeasureDataOscilloscope oscilloscope) { + oscilloscope.setNominalValue(StringUtils.isNotBlank(oscilloscope.getNominalValue()) ? oscilloscope.getNominalValue() + oscilloscope.getNominalValueUnit() : ""); + oscilloscope.setTopMeasureValue(StringUtils.isNotBlank(oscilloscope.getTopMeasureValue()) ? oscilloscope.getTopMeasureValue() + oscilloscope.getTopMeasureValueUnit() : ""); + oscilloscope.setBottomMeasureValue(StringUtils.isNotBlank(oscilloscope.getBottomMeasureValue()) ? oscilloscope.getBottomMeasureValue() + oscilloscope.getBottomMeasureValueUnit() : ""); + oscilloscope.setMeasureValue(StringUtils.isNotBlank(oscilloscope.getMeasureValue()) ? oscilloscope.getMeasureValue() + oscilloscope.getMeasureValueUnit() : ""); + oscilloscope.setTechnicalIndex(StringUtils.isNotBlank(oscilloscope.getTechnicalIndex()) ? oscilloscope.getTechnicalIndexSymbol() + oscilloscope.getTechnicalIndex() + oscilloscope.getTechnicalIndexUnit() : ""); + } + }, +} diff --git a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/business/BizBusinessOutsourcerInfoServiceImpl.java b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/business/BizBusinessOutsourcerInfoServiceImpl.java index 4ba26f8..2832dfa 100644 --- a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/business/BizBusinessOutsourcerInfoServiceImpl.java +++ b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/business/BizBusinessOutsourcerInfoServiceImpl.java @@ -30,6 +30,7 @@ import java.util.HashMap; import java.util.List; +import static com.casic.missiles.enums.PrintFileModuleNameEnum.EXPORT_TEMPLATE; import static com.casic.missiles.enums.PrintFileModuleNameEnum.OUTSOURCER; /** @@ -76,7 +77,7 @@ if (!CollectionUtils.isEmpty(outsourcerInfoList)){ HashMap map = new HashMap<>(); map.put("outsourcerList", outsourcerInfoList); - printFileRegister.registerPrintFile(OUTSOURCER, "1", null, map, true, response); + printFileRegister.registerPrintFile(OUTSOURCER, EXPORT_TEMPLATE, null, map, request.isPdf(), response); } } diff --git a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/OscilloScopeHandler.java b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/OscilloScopeHandler.java index bf72fba..299def4 100644 --- a/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/OscilloScopeHandler.java +++ b/casic-metering-service/src/main/java/com/casic/missiles/service/Impl/eqpt/standard/impl/OscilloScopeHandler.java @@ -20,6 +20,7 @@ import com.casic.missiles.utils.SnowflakeUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; @@ -68,7 +69,7 @@ replaceSlash(map); map.put("pdfStatus", 1); //除了选用的模板不一致,模板配置流程是一致的 - String wordUrl = printFileRegister.registerPrintFile(SPECTRUM_ANALYZER, "数据打印", null, map, false, null, null); + String wordUrl = printFileRegister.registerPrintFile(OSCILLOSCOPE_CHECK_DATA, "数据打印", null, map, false, null, null); List urlList = new ArrayList<>(); if (StringUtils.isNotEmpty(wordUrl)) { urlList.add(wordUrl); @@ -84,49 +85,49 @@ } private void readyForCheckParams(Map map, List oscilloscopeList) { - String[] checkType = {HOUR_MARKERS, SQUARE_WAVE_VOLTAGE_50, + String[] checkParams = {HOUR_MARKERS, SQUARE_WAVE_VOLTAGE_50, SQUARE_WAVE_VOLTAGE_1M, DC_VOLTAGE_50, DC_VOLTAGE_1M, INPUT_IMPEDANCE, SINE_SIGNAL_FLATNESS, RISE_TIME_CHECK}; - String[] checkPoints = {REPEATABILITY, STABILITY}; - for (int i = 0; i < checkType.length; i++) { - String type = checkType[i]; + String[] checkType = {REPEATABILITY, STABILITY}; + for (int i = 0; i < checkParams.length; i++) { + String param = checkParams[i]; int num = i; List repList = oscilloscopeList.stream() - .filter(o -> type.equals(o.getCheckType()) && checkPoints[0].equals(o.getParams())) + .filter(o -> param.equals(o.getParams()) && checkType[0].equals(o.getCheckType())) .map(o -> { o.setCheckPoint(StringUtils.isNotBlank(o.getCheckPoint()) ? o.getCheckPoint() + o.getUnit() : ""); - o.setTypeValue(StringUtils.isNotBlank(o.getTypeValue()) ? o.getTypeValue() + "Vp-p" : ""); +// o.setTypeValue(StringUtils.isNotBlank(o.getTypeValue()) ? o.getTypeValue() + "Vp-p" : ""); if (7 == num) { o.setTestValueOne(StringUtils.isNotBlank(o.getTestValueOne()) ? o.getTestValueOne() + o.getUnit() : o.getTestValueOne()); } return o; }) .collect(Collectors.toList()); - map.put(REPEAT_PREFIX + i + 1, repList); + map.put(REPEAT_PREFIX + (i + 1), repList); List staList = oscilloscopeList.stream() - .filter(o -> type.equals(o.getCheckType()) && checkPoints[1].equals(o.getParams())) + .filter(o -> param.equals(o.getParams()) && checkType[1].equals(o.getCheckType())) .map(o -> { o.setCheckPoint(StringUtils.isNotBlank(o.getCheckPoint()) ? o.getCheckPoint() + o.getUnit() : ""); - o.setTypeValue(StringUtils.isNotBlank(o.getTypeValue()) ? o.getTypeValue() + "Vp-p" : ""); +// o.setTypeValue(StringUtils.isNotBlank(o.getTypeValue()) ? o.getTypeValue() + "Vp-p" : ""); o.setConclusionStr(1 == o.getConclusion() ? "合格" : "不合格"); - o.setTechnicalIndex(StringUtils.isNotBlank(o.getTechnicalIndex())?o.getTechnicalIndexSymbol()+o.getTechnicalIndex()+o.getTechnicalIndexUnit():""); + o.setTechnicalIndex(StringUtils.isNotBlank(o.getTechnicalIndex()) ? o.getTechnicalIndexSymbol() + o.getTechnicalIndex() + o.getTechnicalIndexUnit() : ""); + o.setMaximumErrorAbsolute(StringUtils.isNotBlank(o.getMaximumErrorAbsolute()) ? o.getMaximumErrorAbsolute() + o.getMaximumErrorAbsoluteUnit() : ""); if (7 == num) { o.setTestValueOne(StringUtils.isNotBlank(o.getTestValueOne()) ? o.getTestValueOne() + o.getUnit() : o.getTestValueOne()); } return o; }) .collect(Collectors.toList()); - map.put(STA_PREFIX + i, staList); - List dateList = staList.stream() - .flatMap(o -> Stream.of(o.getTestValueOneDate(), o.getTestValueTwoDate(), - o.getTestValueThreeDate(), o.getTestValueFourDate(), - o.getTestValueFiveDate(), o.getTestValueSixDate())) - .collect(Collectors.toList()); - for (int j = 0; j < dateList.size(); j++) { - map.put(STA_PREFIX + i + DATE_PREFIX + j, dateList.get(j)); - } + map.put(STA_PREFIX + (i + 1), staList); + BizEquipmentStandardCheckDataOscilloscope oscilloscope = staList.get(0); + map.put(STA_PREFIX + (i + 1) + DATE_PREFIX + 1, oscilloscope.getTestValueOneDate()); + map.put(STA_PREFIX + (i + 1) + DATE_PREFIX + 2, oscilloscope.getTestValueTwoDate()); + map.put(STA_PREFIX + (i + 1) + DATE_PREFIX + 3, oscilloscope.getTestValueThreeDate()); + map.put(STA_PREFIX + (i + 1) + DATE_PREFIX + 4, oscilloscope.getTestValueFourDate()); + map.put(STA_PREFIX + (i + 1) + DATE_PREFIX + 5, oscilloscope.getTestValueFiveDate()); + map.put(STA_PREFIX + (i + 1) + DATE_PREFIX + 6, oscilloscope.getTestValueSixDate()); } } @@ -153,14 +154,21 @@ DictCodeUtils.convertDictCodeToName(request); Map map = BeanUtil.beanToMap(request); - readyForCoverParams(map,request.getLabCode()); + readyForCoverParams(map, request.getLabCode()); + + List list = new ArrayList<>(); + for (BizBusinessDeviceMeasureDataOscilloscope oscilloscope : request.getMeasureDataOscilloscopeList()) { + BizBusinessDeviceMeasureDataOscilloscope scope = (BizBusinessDeviceMeasureDataOscilloscope) BeanUtils.cloneBean(oscilloscope); + scope.applyStrategyBasedOnDataType(request.getItemCategoryName()); + list.add(scope); + } switch (request.getItemCategoryName()) { case DIGITAL_OSCILLOSCOPE: - readyForDigitalOriginalFillParams(map, request.getMeasureDataOscilloscopeList()); + readyForDigitalParams(map, list); break; case ANALOG_OSCILLOSCOPE: - readyForImitateOriginalFillParams(map, request.getMeasureDataOscilloscopeList()); + readyForImitateParams(map, list); break; default: throw new BusinessException(BusinessExceptionEnum.EQUIPMENT_ITEM_CATEGORY_NAME_NOT_EXIST); @@ -176,7 +184,7 @@ map.put("pdfStatus", 1); log.debug("original before ----"); //除了选用的模板不一致,模板配置流程是一致的 - String originalWordUrlFile = printFileRegister.registerPrintFile(OSCILLOSCOPE, "原始记录打印", null, map, false, null, templateUrls); + String originalWordUrlFile = printFileRegister.registerPrintFile(request.getItemCategoryName(), "原始记录打印", null, map, false, null, templateUrls); log.debug("originalUrlFile after------------{}", originalWordUrlFile); List urlList = new ArrayList<>(); urlList.add(originalWordUrlFile); @@ -191,198 +199,6 @@ } /** - * 数字示波器原始记录 - * - * @param map - * @param oscilloscopeList - */ - private void readyForDigitalOriginalFillParams(Map map, List oscilloscopeList) { - if (CollectionUtils.isEmpty(oscilloscopeList)) { - throw new BusinessException(BusinessExceptionEnum.EQUIPMENT_MEASURE_DATA_NOT_EXIST); - } - //根据dataType分组,key为dataType,value为List - Map> groupMap = oscilloscopeList.stream() - .filter(Objects::nonNull) // 确保元素不为null - .collect(Collectors.groupingBy(BizBusinessDeviceMeasureDataOscilloscope::getDataType)); - - List baseList = groupMap.get(TIME_BASE).stream() - .map(s -> { - s.setCycleSignal(StringUtils.isNotBlank(s.getCycleSignal()) ? s.getCycleSignal() + s.getCycleSignalUnit() : ""); - s.setTimeBaseRelativeError(StringUtils.isNotBlank(s.getTimeBaseRelativeError()) ? s.getTimeBaseRelativeError() + s.getTimeBaseRelativeErrorUnit() : ""); - s.setTechnicalIndex(StringUtils.isNotBlank(s.getTechnicalIndex()) ? s.getTechnicalIndexSymbol() + s.getTechnicalIndex() + s.getTechnicalIndexUnit() : ""); - return s; - }).collect(Collectors.toList()); - map.put("baseList", baseList); - List gainList = groupMap.get(DC_GAIN).stream() - .map(s -> { - s.setImpedance(StringUtils.isNotBlank(s.getImpedance()) ? s.getImpedance() + s.getImpedanceUnit() : ""); - s.setVerticalScaleGear(StringUtils.isNotBlank(s.getVerticalScaleGear()) ? s.getVerticalScaleGear() + s.getVerticalScaleGearUnit() : ""); - s.setStandardValue(StringUtils.isNotBlank(s.getStandardValue()) ? s.getStandardValue() + s.getStandardValueUnit() : ""); - s.setMeasureValue(StringUtils.isNotBlank(s.getMeasureValue()) ? s.getMeasureValue() + s.getMeasureValueUnit() : ""); - s.setRelativeError(StringUtils.isNotBlank(s.getRelativeError()) ? s.getRelativeError() + "%" : ""); - s.setTechnicalIndex(StringUtils.isNotBlank(s.getTechnicalIndex()) ? s.getTechnicalIndexSymbol() + s.getTechnicalIndex() + s.getTechnicalIndexUnit() : ""); - return s; - }).collect(Collectors.toList()); - map.put("gainList", gainList); - List offetList = groupMap.get(DC_OFFSET).stream() - .map(s -> { - s.setImpedance(StringUtils.isNotBlank(s.getImpedance()) ? s.getImpedance() + s.getImpedanceUnit() : ""); - s.setVerticalScaleGear(StringUtils.isNotBlank(s.getVerticalScaleGear()) ? s.getVerticalScaleGear() + s.getVerticalScaleGearUnit() : ""); - s.setNominalValue(StringUtils.isNotBlank(s.getNominalValue()) ? s.getNominalValue() + s.getNominalValueUnit() : ""); - s.setMeasureValue(StringUtils.isNotBlank(s.getMeasureValue()) ? s.getMeasureValue() + s.getMeasureValueUnit() : ""); - s.setRelativeError(StringUtils.isNotBlank(s.getRelativeError()) ? s.getRelativeError() + "%" : ""); - s.setTechnicalIndex(StringUtils.isNotBlank(s.getTechnicalIndex()) ? s.getTechnicalIndexSymbol() + s.getTechnicalIndex() + s.getTechnicalIndexUnit() : ""); - return s; - }).collect(Collectors.toList()); - map.put("offsetList", offetList); - List bandwidthList = groupMap.get(OSCILLOSCOPE_FREQUENCY_BAND_WIDTH).stream() - .map(s -> { - s.setImpedance(StringUtils.isNotBlank(s.getImpedance()) ? s.getImpedance() + s.getImpedanceUnit() : ""); - s.setVerticalScaleGear(StringUtils.isNotBlank(s.getVerticalScaleGear()) ? s.getVerticalScaleGear() + s.getVerticalScaleGearUnit() : ""); - s.setReferenceAmplitude(StringUtils.isNotBlank(s.getReferenceAmplitude()) ? s.getReferenceAmplitude() + s.getReferenceAmplitudeUnit() : ""); - s.setMeasureAmplitude(StringUtils.isNotBlank(s.getMeasureAmplitude()) ? s.getMeasureAmplitude() + s.getMeasureAmplitudeUnit() : ""); - s.setDecibelNumber(StringUtils.isNotBlank(s.getDecibelNumber()) ? s.getDecibelNumber() + "dB" : ""); - s.setTechnicalIndex(StringUtils.isNotBlank(s.getTechnicalIndex()) ? s.getTechnicalIndexSymbol() + s.getTechnicalIndex() + s.getTechnicalIndexUnit() : ""); - return s; - }).collect(Collectors.toList()); - map.put("bandwidthList", bandwidthList); - List sensitivityList = groupMap.get(TRIGGER_SENSITIVITY).stream() - .map(s -> { - s.setSignalFrequency(StringUtils.isNotBlank(s.getSignalFrequency()) ? s.getSignalFrequency() + s.getSignalFrequencyUnit() : ""); - s.setMeasureValue(StringUtils.isNotBlank(s.getMeasureValue()) ? s.getMeasureValue() + s.getMeasureValueUnit() : ""); - s.setTechnicalIndex(StringUtils.isNotBlank(s.getTechnicalIndex()) ? s.getTechnicalIndexSymbol() + s.getTechnicalIndex() + s.getTechnicalIndexUnit() : ""); - return s; - }).collect(Collectors.toList()); - map.put("sensitivityList", sensitivityList); - List riseTimeList = groupMap.get(RISE_TIME).stream() - .map(s -> { - s.setImpedance(StringUtils.isNotBlank(s.getImpedance()) ? s.getImpedance() + s.getImpedanceUnit() : ""); - s.setVerticalScaleGear(StringUtils.isNotBlank(s.getVerticalScaleGear()) ? s.getVerticalScaleGear() + s.getVerticalScaleGearUnit() : ""); - s.setCorrectRiseTime(StringUtils.isNotBlank(s.getCorrectRiseTime()) ? s.getCorrectRiseTime() + "ns" : ""); - s.setTechnicalIndex(StringUtils.isNotBlank(s.getTechnicalIndex()) ? s.getTechnicalIndexSymbol() + s.getTechnicalIndex() + s.getTechnicalIndexUnit() : ""); - return s; - }).collect(Collectors.toList()); - map.put("timeList", riseTimeList); - List inputList = groupMap.get(OSCILLOSCOPE_INPUT_RESISTANCE).stream() - .map(s -> { - s.setImpedance(StringUtils.isNotBlank(s.getImpedance()) ? s.getImpedance() + s.getImpedanceUnit() : ""); - s.setVerticalScaleGear(StringUtils.isNotBlank(s.getVerticalScaleGear()) ? s.getVerticalScaleGear() + s.getVerticalScaleGearUnit() : ""); - s.setMeasureValue(StringUtils.isNotBlank(s.getMeasureValue()) ? s.getMeasureValue() + s.getMeasureValueUnit() : ""); - s.setRelativeError(StringUtils.isNotBlank(s.getRelativeError()) ? s.getRelativeError() + "%" : ""); - s.setTechnicalIndex(StringUtils.isNotBlank(s.getTechnicalIndex()) ? s.getTechnicalIndexSymbol() + s.getTechnicalIndex() + s.getTechnicalIndexUnit() : ""); - return s; - }).collect(Collectors.toList()); - map.put("inputList", inputList); - List signalList = groupMap.get(SIGNAL).stream() - .map(s -> { - s.setNominalValue(StringUtils.isNotBlank(s.getNominalValue()) ? s.getNominalValue() + s.getNominalValueUnit() : ""); - s.setTopMeasureValue(StringUtils.isNotBlank(s.getTopMeasureValue()) ? s.getTopMeasureValue() + s.getTopMeasureValueUnit() : ""); - s.setBottomMeasureValue(StringUtils.isNotBlank(s.getBottomMeasureValue()) ? s.getBottomMeasureValue() + s.getBottomMeasureValueUnit() : ""); - s.setMeasureValue(StringUtils.isNotBlank(s.getMeasureValue()) ? s.getMeasureValue() + s.getMeasureValueUnit() : ""); - s.setRelativeError(StringUtils.isNotBlank(s.getRelativeError()) ? s.getRelativeError() + "%" : ""); - s.setTechnicalIndex(StringUtils.isNotBlank(s.getTechnicalIndex()) ? s.getTechnicalIndexSymbol() + s.getTechnicalIndex() + s.getTechnicalIndexUnit() : ""); - return s; - }).collect(Collectors.toList()); - map.put("signalList", signalList); - } - - - /** - * 模拟示波器原始记录 - * - * @param map - * @param oscilloscopeList - */ - private void readyForImitateOriginalFillParams(Map map, List oscilloscopeList) { - if (CollectionUtils.isEmpty(oscilloscopeList)) { - throw new BusinessException(BusinessExceptionEnum.EQUIPMENT_MEASURE_DATA_NOT_EXIST); - } - //根据dataType分组,key为dataType,value为List - Map> groupMap = oscilloscopeList.stream() - .filter(Objects::nonNull) // 确保元素不为null - .collect(Collectors.groupingBy(BizBusinessDeviceMeasureDataOscilloscope::getDataType)); - //扫描时间系数及扩展 - List expansionList = groupMap.get(SCAN_TIME_COEFFICIENT_AND_EXPANSION) - .stream() - .map(e -> { - e.setImpedance(StringUtils.isNotBlank(e.getImpedance()) ? e.getImpedance() + e.getImpedanceUnit() : ""); - e.setHorizontalScaleGear(StringUtils.isNotBlank(e.getHorizontalScaleGear()) ? e.getHorizontalScaleGear() + e.getHorizontalScaleGearUnit() : ""); - e.setRelativeError(StringUtils.isNotBlank(e.getRelativeError()) ? e.getRelativeError() + "%" : ""); - e.setTechnicalIndex(StringUtils.isNotBlank(e.getTechnicalIndex()) ? e.getTechnicalIndexSymbol() + e.getTechnicalIndex() + e.getTechnicalIndexUnit() : ""); - return e; - }).collect(Collectors.toList()); - map.put("expansionList", expansionList); - //垂直幅度测量 - List verticalList = groupMap.get(VERTICAL_AMPLITUDE_MEASUREMENT) - .stream() - .map(e -> { - e.setImpedance(StringUtils.isNotBlank(e.getImpedance()) ? e.getImpedance() + e.getImpedanceUnit() : ""); - e.setVerticalScaleGear(StringUtils.isNotBlank(e.getVerticalScaleGear()) ? e.getVerticalScaleGear() + e.getVerticalScaleGearUnit() : ""); - e.setRelativeError(StringUtils.isNotBlank(e.getRelativeError()) ? e.getRelativeError() + "%" : ""); - e.setTechnicalIndex(StringUtils.isNotBlank(e.getTechnicalIndex()) ? e.getTechnicalIndexSymbol() + e.getTechnicalIndex() + e.getTechnicalIndexUnit() : ""); - return e; - }).collect(Collectors.toList()); - map.put("verticalList", verticalList); - //频带宽度 - List widthList = groupMap.get(FREQUENCY_BAND_WIDTH) - .stream() - .map(e -> { - e.setImpedance(StringUtils.isNotBlank(e.getImpedance()) ? e.getImpedance() + e.getImpedanceUnit() : ""); - e.setVerticalScaleGear(StringUtils.isNotBlank(e.getVerticalScaleGear()) ? e.getVerticalScaleGear() + e.getVerticalScaleGearUnit() : ""); - e.setBandWidth(StringUtils.isNotBlank(e.getBandWidth()) ? e.getBandWidth() + e.getBandWidthUnit() : ""); - e.setTechnicalIndex(StringUtils.isNotBlank(e.getTechnicalIndex()) ? e.getTechnicalIndexSymbol() + e.getTechnicalIndex() + e.getTechnicalIndexUnit() : ""); - return e; - }).collect(Collectors.toList()); - map.put("widthList", widthList); - //触发特性 - List triggerList = groupMap.get(TRIGGER_CHARACTERISTICS) - .stream() - .map(e -> { - e.setImpedance(StringUtils.isNotBlank(e.getImpedance()) ? e.getImpedance() + e.getImpedanceUnit() : ""); - e.setSignalFrequency(StringUtils.isNotBlank(e.getSignalFrequency()) ? e.getSignalFrequency() + e.getSignalFrequencyUnit() : ""); - e.setMeasureValue(StringUtils.isNotBlank(e.getMeasureValue()) ? e.getMeasureValue() + e.getMeasureValueUnit() : ""); - e.setTechnicalIndex(StringUtils.isNotBlank(e.getTechnicalIndex()) ? e.getTechnicalIndexSymbol() + e.getTechnicalIndex() + e.getTechnicalIndexUnit() : ""); - return e; - }).collect(Collectors.toList()); - map.put("triggerList", triggerList); - //输入电阻 - List resistanceList = groupMap.get(INPUT_RESISTANCE) - .stream() - .map(e -> { - e.setImpedance(StringUtils.isNotBlank(e.getImpedance()) ? e.getImpedance() + e.getImpedanceUnit() : ""); - e.setMeasureValue(StringUtils.isNotBlank(e.getMeasureValue()) ? e.getMeasureValue() + e.getMeasureValueUnit() : ""); - e.setRelativeError(StringUtils.isNotBlank(e.getRelativeError()) ? e.getRelativeError() + "%" : ""); - e.setTechnicalIndex(StringUtils.isNotBlank(e.getTechnicalIndex()) ? e.getTechnicalIndexSymbol() + e.getTechnicalIndex() + e.getTechnicalIndexUnit() : ""); - return e; - }).collect(Collectors.toList()); - map.put("resistanceList", resistanceList); - //上升时间 - List riseList = groupMap.get(RISE_TIME) - .stream() - .map(e -> { - e.setImpedance(StringUtils.isNotBlank(e.getImpedance()) ? e.getImpedance() + e.getImpedanceUnit() : ""); - e.setVerticalScaleGear(StringUtils.isNotBlank(e.getVerticalScaleGear()) ? e.getVerticalScaleGear() + e.getVerticalScaleGearUnit() : ""); - e.setCorrectRiseTime(StringUtils.isNotBlank(e.getCorrectRiseTime()) ? e.getCorrectRiseTime() + "ns" : ""); - e.setTechnicalIndex(StringUtils.isNotBlank(e.getTechnicalIndex()) ? e.getTechnicalIndexSymbol() + e.getTechnicalIndex() + e.getTechnicalIndexUnit() : ""); - return e; - }).collect(Collectors.toList()); - map.put("riseList", riseList); - //校准信号 - List signalList = groupMap.get(OSCILLOSCOPE_CALIBRATION_SIGNAL) - .stream() - .map(e -> { - e.setNominalAmplitudeValue(StringUtils.isNotBlank(e.getNominalAmplitudeValue()) ? e.getNominalAmplitudeValue() + e.getNominalAmplitudeValueUnit() : ""); - e.setMeasureAmplitudeValue(StringUtils.isNotBlank(e.getMeasureAmplitudeValue()) ? e.getMeasureAmplitudeValue() + e.getMeasureValueUnit() : ""); - e.setAmplitudeDeviation(StringUtils.isNotBlank(e.getAmplitudeDeviation()) ? e.getAmplitudeDeviation() + "%" : ""); - e.setTechnicalIndex(StringUtils.isNotBlank(e.getTechnicalIndex()) ? e.getTechnicalIndexSymbol() + e.getTechnicalIndex() + e.getTechnicalIndexUnit() : ""); - e.setMeasureFrequencyValue(StringUtils.isNotBlank(e.getMeasureFrequencyValue()) ? e.getMeasureFrequencyValue() + e.getMeasureFrequencyValueUnit() : ""); - e.setFrequencyDeviation(StringUtils.isNotBlank(e.getFrequencyDeviation()) ? e.getFrequencyDeviation() + "%" : ""); - return e; - }).collect(Collectors.toList()); - map.put("signalList", signalList); - } - - /** * @param request * @return */ @@ -402,14 +218,21 @@ DictCodeUtils.convertDictCodeToName(request); Map map = BeanUtil.beanToMap(request); - readyForCoverParams(map,request.getLabCode()); + readyForCoverParams(map, request.getLabCode()); + + List list = new ArrayList<>(); + for (BizBusinessDeviceMeasureDataOscilloscope oscilloscope : request.getMeasureDataOscilloscopeList()) { + BizBusinessDeviceMeasureDataOscilloscope scope = (BizBusinessDeviceMeasureDataOscilloscope) BeanUtils.cloneBean(oscilloscope); + scope.applyStrategyBasedOnDataType(request.getItemCategoryName()); + list.add(scope); + } switch (request.getItemCategoryName()) { case DIGITAL_OSCILLOSCOPE: - readyForDigitalCertificateFillParams(map, request.getMeasureDataOscilloscopeList()); + readyForDigitalParams(map, list); break; case ANALOG_OSCILLOSCOPE: - readyForImitateCertificateFillParams(map, request.getMeasureDataOscilloscopeList()); + readyForImitateParams(map, list); break; default: throw new BusinessException(BusinessExceptionEnum.EQUIPMENT_ITEM_CATEGORY_NAME_NOT_EXIST); @@ -427,7 +250,7 @@ List urlList = new ArrayList<>(); //除了选用的模板不一致,模板配置流程是一致的 log.debug("certificate before------------"); - String wordUrl = printFileRegister.registerPrintFile(OSCILLOSCOPE, "证书打印", null, map, false, null, customTemplateUrls); + String wordUrl = printFileRegister.registerPrintFile(request.getItemCategoryName(), "证书打印", null, map, false, null, customTemplateUrls); urlList.add(wordUrl); if (map.containsKey("pdfUrl")) { urlList.add((String) map.get("pdfUrl")); @@ -446,13 +269,12 @@ * @param map * @param oscilloscopeList */ - private void readyForImitateCertificateFillParams(Map map, List oscilloscopeList) { + private void readyForImitateParams(Map map, List oscilloscopeList) { if (CollectionUtils.isEmpty(oscilloscopeList)) { throw new BusinessException(BusinessExceptionEnum.EQUIPMENT_MEASURE_DATA_NOT_EXIST); } //根据dataType分组,key为dataType,value为List Map> groupMap = oscilloscopeList.stream() - .filter(Objects::nonNull) // 确保元素不为null .collect(Collectors.groupingBy(BizBusinessDeviceMeasureDataOscilloscope::getDataType)); //扫描时间系数及扩展 List expansionList = groupMap.get(SCAN_TIME_COEFFICIENT_AND_EXPANSION); @@ -483,13 +305,12 @@ * @param map * @param oscilloscopeList */ - private void readyForDigitalCertificateFillParams(Map map, List oscilloscopeList) { + private void readyForDigitalParams(Map map, List oscilloscopeList) { if (CollectionUtils.isEmpty(oscilloscopeList)) { throw new BusinessException(BusinessExceptionEnum.EQUIPMENT_MEASURE_DATA_NOT_EXIST); } //根据dataType分组,key为dataType,value为List Map> groupMap = oscilloscopeList.stream() - .filter(Objects::nonNull) // 确保元素不为null .collect(Collectors.groupingBy(BizBusinessDeviceMeasureDataOscilloscope::getDataType)); List baseList = groupMap.get(TIME_BASE);