|
@@ -31,11 +31,24 @@ public class DataWarehouseService {
|
|
|
this.dataWarehouseProperties = dataWarehouseProperties;
|
|
|
}
|
|
|
|
|
|
+ // TODO
|
|
|
+ public void checkSource(String day) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // TODO
|
|
|
+ private boolean checkHighQualityListDay(String day) {
|
|
|
+ String fileName = dataWarehouseProperties.getPrefixOfHighQualityListDay() + day + ".csv";
|
|
|
+ Path path = Paths.get(dataWarehouseProperties.getDirOfHighQualityListDay(), fileName);
|
|
|
+ return path.toFile().exists();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public void warehouseHighQualityListDay(String day) {
|
|
|
String fileName = dataWarehouseProperties.getPrefixOfHighQualityListDay() + day + ".csv";
|
|
|
Path path = Paths.get(dataWarehouseProperties.getDirOfHighQualityListDay(), fileName);
|
|
|
warehouseHighQualityListDay(path.toFile());
|
|
|
- log.info("河北高质量2日明细数据入库成功: {}...", day);
|
|
|
+ log.info("河北_CEM高质量2日明细数据入库成功: {}...", day);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -53,6 +66,7 @@ public class DataWarehouseService {
|
|
|
.build().parse(reader);
|
|
|
List<CSVRecord> records = parser.getRecords();
|
|
|
List<Object[]> list = new ArrayList<>();
|
|
|
+ // 查找全部需要筛选的类型
|
|
|
Set<String> allServTypeNames = sysDataDictionaryRepository.findAllServTypeNames();
|
|
|
for (CSVRecord record : records) {
|
|
|
// 按照serv_type_name进行筛选
|
|
@@ -67,7 +81,79 @@ public class DataWarehouseService {
|
|
|
tslDataDao.batchInsertHighQualityListDay(list);
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
- throw new RuntimeException("河北高质量2日明细数据入库失败..." + e.getMessage());
|
|
|
+ throw new RuntimeException("河北_CEM高质量2日明细数据入库失败..." + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void warehouseMobileComplaintDay(String day) {
|
|
|
+ String fileName = dataWarehouseProperties.getPrefixOfMobileComplaint() + day + ".csv";
|
|
|
+ Path path = Paths.get(dataWarehouseProperties.getDirOfMobileComplaint(), fileName);
|
|
|
+ warehouseMobileComplaintDay(path.toFile());
|
|
|
+ log.info("河北_CEM移网质量投诉明细数据入库成功: {}...", day);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 入库 河北_CEM移网质量投诉明细
|
|
|
+ */
|
|
|
+ private void warehouseMobileComplaintDay(File file) {
|
|
|
+ try (Reader reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8)) {
|
|
|
+ // SOH作为分割符
|
|
|
+ char delimiter = 1;
|
|
|
+ CSVParser parser = CSVFormat.DEFAULT.builder()
|
|
|
+ .setRecordSeparator("\n")
|
|
|
+ .setQuote(null)
|
|
|
+ .setDelimiter(delimiter)
|
|
|
+ .setSkipHeaderRecord(false)
|
|
|
+ .build().parse(reader);
|
|
|
+ List<CSVRecord> records = parser.getRecords();
|
|
|
+ List<Object[]> list = new ArrayList<>();
|
|
|
+ for (CSVRecord record : records) {
|
|
|
+ Object[] ps = new Object[dataWarehouseProperties.getFiledNumOfMobileComplaint().intValue()];
|
|
|
+ list.add(ps);
|
|
|
+ for (int i = 0; i < ps.length; i++) {
|
|
|
+ ps[i] = record.get(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tslDataDao.batchInsertHighQualityListDay(list);
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException("河北_CEM移网质量投诉明细数据入库失败..." + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void warehouseHighQualityCountDay(String day) {
|
|
|
+ String fileName = dataWarehouseProperties.getPrefixOfHighQualityCountDay() + day + ".csv";
|
|
|
+ Path path = Paths.get(dataWarehouseProperties.getDirOfHighQualityCountDay(), fileName);
|
|
|
+ warehouseHighQualityCountDay(path.toFile());
|
|
|
+ log.info("河北_CEM高品质2日统计数据入库成功: {}...", day);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 入库 河北_CEM高品质2日统计
|
|
|
+ */
|
|
|
+ private void warehouseHighQualityCountDay(File file) {
|
|
|
+ try (Reader reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8)) {
|
|
|
+ // SOH作为分割符
|
|
|
+ char delimiter = 1;
|
|
|
+ CSVParser parser = CSVFormat.DEFAULT.builder()
|
|
|
+ .setRecordSeparator("\n")
|
|
|
+ .setQuote(null)
|
|
|
+ .setDelimiter(delimiter)
|
|
|
+ .setSkipHeaderRecord(false)
|
|
|
+ .build().parse(reader);
|
|
|
+ List<CSVRecord> records = parser.getRecords();
|
|
|
+ List<Object[]> list = new ArrayList<>();
|
|
|
+ for (CSVRecord record : records) {
|
|
|
+ Object[] ps = new Object[dataWarehouseProperties.getFiledNumOfMobileComplaint().intValue()];
|
|
|
+ list.add(ps);
|
|
|
+ for (int i = 0; i < ps.length; i++) {
|
|
|
+ ps[i] = record.get(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tslDataDao.batchInsertHighQualityListDay(list);
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException("河北_CEM高品质2日统计数据入库失败..." + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
}
|