fix: 增加sheet页排序和化学需氧量指标
This commit is contained in:
parent
bc1910b8d2
commit
d5549e1541
@ -0,0 +1,30 @@
|
||||
package com.yfd.platform.qgc_export.processor;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 电导率(COND) 指标处理器
|
||||
*/
|
||||
@Component
|
||||
public class CodcrProcessor extends WqIndicatorProcessor {
|
||||
|
||||
@Override
|
||||
public String getFieldName() {
|
||||
return "CODCR";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSheetName() {
|
||||
return "水质(化学需氧量)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDecimalPlaces() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 12;
|
||||
}
|
||||
}
|
||||
@ -24,7 +24,7 @@ public class CondProcessor extends WqIndicatorProcessor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSttpType() {
|
||||
return "WQ";
|
||||
public int getOrder() {
|
||||
return 13;
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ public class DoxProcessor extends WqIndicatorProcessor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSttpType() {
|
||||
return "WQ";
|
||||
public int getOrder() {
|
||||
return 11;
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,4 +19,9 @@ public class DwtProcessor extends WtrvIndicatorProcessor {
|
||||
public String getSheetName() {
|
||||
return "出库水温";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 8;
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,4 +24,9 @@ public class DwtVariationProcessor extends WtrvIndicatorProcessor {
|
||||
public boolean isVariation() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 9;
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,4 +17,9 @@ public class DzProcessor extends HydropwIndicatorProcessor {
|
||||
public String getSheetName() {
|
||||
return "坝下水位";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,4 +22,9 @@ public class DzVariationProcessor extends HydropwIndicatorProcessor {
|
||||
public boolean isVariation() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,6 +56,14 @@ public interface ExportIndicatorProcessor {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sheet 排序号,升序排列。
|
||||
* 数值越小越靠前,同组指标标准格式应排在日变幅格式之前。
|
||||
*/
|
||||
default int getOrder() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询原始数据
|
||||
*
|
||||
|
||||
@ -24,7 +24,7 @@ public class PhProcessor extends WqIndicatorProcessor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSttpType() {
|
||||
return "WQ";
|
||||
public int getOrder() {
|
||||
return 15;
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,17 +9,14 @@ import org.springframework.stereotype.Component;
|
||||
public class QProcessor extends RiverIndicatorProcessor {
|
||||
|
||||
@Override
|
||||
public String getFieldName() {
|
||||
return "Q";
|
||||
}
|
||||
public String getFieldName() { return "Q"; }
|
||||
|
||||
@Override
|
||||
public String getSheetName() {
|
||||
return "流量(m³/s)";
|
||||
}
|
||||
public String getSheetName() { return "流量(m³/s)"; }
|
||||
|
||||
@Override
|
||||
public String getSttpType() {
|
||||
return "ZQ";
|
||||
}
|
||||
public String getSttpType() { return "ZQ"; }
|
||||
|
||||
@Override
|
||||
public int getOrder() { return 32; }
|
||||
}
|
||||
|
||||
@ -17,4 +17,9 @@ public class RzProcessor extends HydropwIndicatorProcessor {
|
||||
public String getSheetName() {
|
||||
return "坝上水位";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,4 +22,9 @@ public class RzVariationProcessor extends HydropwIndicatorProcessor {
|
||||
public boolean isVariation() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ public class TuProcessor extends WqIndicatorProcessor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSttpType() {
|
||||
return "WQ";
|
||||
public int getOrder() {
|
||||
return 14;
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,17 +9,14 @@ import org.springframework.stereotype.Component;
|
||||
public class VProcessor extends RiverIndicatorProcessor {
|
||||
|
||||
@Override
|
||||
public String getFieldName() {
|
||||
return "V";
|
||||
}
|
||||
public String getFieldName() { return "V"; }
|
||||
|
||||
@Override
|
||||
public String getSheetName() {
|
||||
return "流速(m/s)";
|
||||
}
|
||||
public String getSheetName() { return "流速(m/s)"; }
|
||||
|
||||
@Override
|
||||
public String getSttpType() {
|
||||
return "ZQ";
|
||||
}
|
||||
public String getSttpType() { return "ZQ"; }
|
||||
|
||||
@Override
|
||||
public int getOrder() { return 33; }
|
||||
}
|
||||
|
||||
@ -24,8 +24,7 @@ public class WtmpProcessor extends WqIndicatorProcessor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSttpType() {
|
||||
return "WQ";
|
||||
public int getOrder() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -9,17 +9,14 @@ import org.springframework.stereotype.Component;
|
||||
public class ZProcessor extends RiverIndicatorProcessor {
|
||||
|
||||
@Override
|
||||
public String getFieldName() {
|
||||
return "Z";
|
||||
}
|
||||
public String getFieldName() { return "Z"; }
|
||||
|
||||
@Override
|
||||
public String getSheetName() {
|
||||
return "水位(m)";
|
||||
}
|
||||
public String getSheetName() { return "水位(m)"; }
|
||||
|
||||
@Override
|
||||
public String getSttpType() {
|
||||
return "ZQ";
|
||||
}
|
||||
public String getSttpType() { return "ZQ"; }
|
||||
|
||||
@Override
|
||||
public int getOrder() { return 31; }
|
||||
}
|
||||
|
||||
@ -86,6 +86,8 @@ public class QgcExportServiceImpl implements IQgcExportService {
|
||||
@Resource
|
||||
private WtmpProcessor wtmpProcessor;
|
||||
@Resource
|
||||
private CodcrProcessor codcrProcessor;
|
||||
@Resource
|
||||
private PhProcessor phProcessor;
|
||||
@Resource
|
||||
private DoxProcessor doxProcessor;
|
||||
@ -288,6 +290,7 @@ public class QgcExportServiceImpl implements IQgcExportService {
|
||||
Map<String, ExportIndicatorProcessor> processorMap = new LinkedHashMap<>();
|
||||
// WQ 在前
|
||||
processorMap.put("wtmp", wtmpProcessor);
|
||||
processorMap.put("codcr", codcrProcessor);
|
||||
processorMap.put("ph", phProcessor);
|
||||
processorMap.put("dox", doxProcessor);
|
||||
processorMap.put("cond", condProcessor);
|
||||
@ -302,7 +305,7 @@ public class QgcExportServiceImpl implements IQgcExportService {
|
||||
for (String field : dataFields) {
|
||||
String lower = field.trim().toLowerCase();
|
||||
if ("wq".equals(lower)) {
|
||||
expanded.addAll(List.of("wtmp", "ph", "dox", "cond", "tu"));
|
||||
expanded.addAll(List.of("wtmp","codcr", "ph", "dox", "cond", "tu"));
|
||||
} else {
|
||||
expanded.add(lower);
|
||||
}
|
||||
@ -345,6 +348,7 @@ public class QgcExportServiceImpl implements IQgcExportService {
|
||||
result.add(p);
|
||||
}
|
||||
}
|
||||
result.sort(Comparator.comparingInt(ExportIndicatorProcessor::getOrder));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user