Browse Source

优化定时导出内容

优化设备在线率分析页面设备类型
develop
zhaoxianglong 5 months ago
parent
commit
65d95ba62c
  1. 6
      zc-business/src/main/java/com/zc/business/controller/StatusController.java
  2. 16
      zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java
  3. 199
      zc-business/src/main/java/com/zc/business/service/impl/ExcelExportService.java

6
zc-business/src/main/java/com/zc/business/controller/StatusController.java

@ -267,6 +267,8 @@ public class StatusController extends BaseController {
itemTypeMap.put(UniversalEnum.ELEVEN.getValue(), UniversalEnum.CLASS_I_TRAFFIC_SURVEY_STATION.getValue());
itemTypeMap.put(UniversalEnum.TWELVE.getValue(), UniversalEnum.INTELLIGENT_DRIVING_GUIDANCE_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.THIRTEEN.getValue(), UniversalEnum.SMART_DEVICE_BOX.getValue());
itemTypeMap.put(UniversalEnum.FIFTEEN.getValue(), UniversalEnum.SOLAR_PANEL.getValue());
itemTypeMap.put(UniversalEnum.SIXTEEN.getValue(), UniversalEnum.REMOTE_COMPUTER.getValue());
LocalDateTime todayStart = LocalDateTime.now().truncatedTo(ChronoUnit.DAYS);
LocalDateTime currentTime = LocalDateTime.now();
Status status = new Status();
@ -394,7 +396,9 @@ public class StatusController extends BaseController {
UniversalEnum.LASER_FATIGUE_AWAKENING.getValue(),
UniversalEnum.CLASS_I_TRAFFIC_SURVEY_STATION.getValue(),
UniversalEnum.INTELLIGENT_DRIVING_GUIDANCE_SYSTEM.getValue(),
UniversalEnum.SMART_DEVICE_BOX.getValue()
UniversalEnum.SMART_DEVICE_BOX.getValue(),
UniversalEnum.SOLAR_PANEL.getValue(),
UniversalEnum.REMOTE_COMPUTER.getValue()
};
orderRule= Arrays.toString(rules).replace(UniversalEnum.LEFT_CENTER_BRACKET.getValue(),UniversalEnum.EMPTY_STRING.getValue()).replace(UniversalEnum.CLOSE_CENTER_BRACKET.getValue(),UniversalEnum.EMPTY_STRING.getValue()).replace(UniversalEnum.BLANK_SPACE.getValue(),UniversalEnum.EMPTY_STRING.getValue());
ruleMap.put("rule",orderRule);

16
zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java

@ -338,10 +338,16 @@ public enum UniversalEnum {
ROAD_SECTION_NAME(0, "路段名称"),
// 菏泽方向
DIRECTION_OF_HEZE(0, "菏泽方向"),
DIRECTION_OF_HEZE(1, "菏泽方向"),
// 双向
BIDIRECTIONAL(2, "双向"),
// 济南方向
DIRECTION_OF_JINAN(0, "济南方向"),
DIRECTION_OF_JINAN(3, "济南方向"),
// 未知方向
UNKNOWN_DIRECTION(4, "未知方向"),
// 上行
Up(0, "上行"),
@ -409,6 +415,12 @@ public enum UniversalEnum {
//智能设备箱
SMART_DEVICE_BOX(0, "智能设备箱"),
//太阳能板
SOLAR_PANEL(0, "太阳能板"),
//远端机
REMOTE_COMPUTER(0, "远端机"),
//设备名称
DEVICE_NAME(0, "设备名称"),

199
zc-business/src/main/java/com/zc/business/service/impl/ExcelExportService.java

@ -17,7 +17,7 @@ import java.util.stream.Collectors;
@Service
public class ExcelExportService {
public void exportDataToExcel(Map<Integer, List<Status>> ipMap, Map<String, List<Status> >categoryMap, String filePath) {
public void exportDataToExcel(Map<Integer, List<Status>> ipMap, Map<String, List<Status>> categoryMap, String filePath) {
Workbook workbook = new XSSFWorkbook();
Map<Integer, List<Status>> map = new TreeMap<>(ipMap);
Sheet sheet = workbook.createSheet(UniversalEnum.DEVICE_FAILURE_RATE_TIME_SHARING_STATISTICS_PAGE.getValue());
@ -37,41 +37,50 @@ public class ExcelExportService {
sheet.addMergedRegion(new CellRangeAddress(UniversalEnum.ZERO.getNumber(), UniversalEnum.ONE.getNumber(), UniversalEnum.FOUR.getNumber(), UniversalEnum.FOUR.getNumber()));
sheet.addMergedRegion(new CellRangeAddress(UniversalEnum.ZERO.getNumber(), UniversalEnum.ONE.getNumber(), UniversalEnum.FIVE.getNumber(), UniversalEnum.FIVE.getNumber()));
sheet.addMergedRegion(new CellRangeAddress(UniversalEnum.ZERO.getNumber(), UniversalEnum.ONE.getNumber(), UniversalEnum.SIX.getNumber(), UniversalEnum.SIX.getNumber()));
int i=UniversalEnum.ZERO.getNumber();
boolean flag = true;
Row row1= sheet.createRow(UniversalEnum.ONE.getNumber());
int i = UniversalEnum.ZERO.getNumber();
boolean flag = true;
Row row1 = sheet.createRow(UniversalEnum.ONE.getNumber());
for (Map.Entry<Integer, List<Status>> entry : map.entrySet()) {
row0.createCell(UniversalEnum.TWO.getNumber()*i+UniversalEnum.SEVEN.getNumber()).setCellValue(entry.getKey()+UniversalEnum.HOUR.getValue());
sheet.addMergedRegion(new CellRangeAddress(UniversalEnum.ZERO.getNumber(), UniversalEnum.ZERO.getNumber(), UniversalEnum.TWO.getNumber()*i+UniversalEnum.SEVEN.getNumber(), UniversalEnum.TWO.getNumber()*i+UniversalEnum.EIGHT.getNumber()));
row1.createCell(UniversalEnum.TWO.getNumber()*i+UniversalEnum.SEVEN.getNumber()).setCellValue(UniversalEnum.ONLINE_RATE.getValue());
row1.createCell(UniversalEnum.TWO.getNumber()*i+UniversalEnum.EIGHT.getNumber()).setCellValue(UniversalEnum.PACKET_LOSS_RATE.getValue());
row0.createCell(UniversalEnum.TWO.getNumber() * i + UniversalEnum.SEVEN.getNumber()).setCellValue(entry.getKey() + UniversalEnum.HOUR.getValue());
sheet.addMergedRegion(new CellRangeAddress(UniversalEnum.ZERO.getNumber(), UniversalEnum.ZERO.getNumber(), UniversalEnum.TWO.getNumber() * i + UniversalEnum.SEVEN.getNumber(), UniversalEnum.TWO.getNumber() * i + UniversalEnum.EIGHT.getNumber()));
row1.createCell(UniversalEnum.TWO.getNumber() * i + UniversalEnum.SEVEN.getNumber()).setCellValue(UniversalEnum.ONLINE_RATE.getValue());
row1.createCell(UniversalEnum.TWO.getNumber() * i + UniversalEnum.EIGHT.getNumber()).setCellValue(UniversalEnum.PACKET_LOSS_RATE.getValue());
rowNum = UniversalEnum.TWO.getNumber();
List<Status> groupItems = entry.getValue();
for (Status ignored : groupItems) {
int a=rowNum++;
Row row = sheet.getRow(a); // 获取指定索引的行
if (row == null) { // 如果行不存在,则创建新行
row = sheet.createRow(a);
}
if(flag) {
row.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(ignored.getDeviceName());
row.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(ignored.getDeviceIp());
row.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(ignored.getDeviceNo());
row.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(ignored.getDirection());
row.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(ignored.getProduction());
row.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(ignored.getModel());
row.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(ignored.getContent());
List<Status> groupItems = entry.getValue();
for (Status ignored : groupItems) {
int a = rowNum++;
Row row = sheet.getRow(a); // 获取指定索引的行
if (row == null) { // 如果行不存在,则创建新行
row = sheet.createRow(a);
}
if (flag) {
row.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(ignored.getDeviceName());
row.createCell(UniversalEnum.ONE.getNumber()).setCellValue(ignored.getDeviceIp());
row.createCell(UniversalEnum.TWO.getNumber()).setCellValue(ignored.getDeviceNo());
Integer direction = Integer.parseInt(ignored.getDirection() != null ? ignored.getDirection() : UniversalEnum.FOUR.getValue());
String directionDescription = UniversalEnum.UNKNOWN_DIRECTION.getValue();
if (Objects.equals(direction, UniversalEnum.DIRECTION_OF_HEZE.getNumber())) {
directionDescription = UniversalEnum.DIRECTION_OF_HEZE.getValue();
} else if (Objects.equals(direction, UniversalEnum.BIDIRECTIONAL.getNumber())) {
directionDescription = UniversalEnum.BIDIRECTIONAL.getValue();
} else if (Objects.equals(direction, UniversalEnum.DIRECTION_OF_JINAN.getNumber())) {
directionDescription = UniversalEnum.DIRECTION_OF_JINAN.getValue();
}
row.createCell(UniversalEnum.TWO.getNumber()*i+UniversalEnum.SEVEN.getNumber()).setCellValue(ignored.getSuccessRate());
row.createCell(UniversalEnum.TWO.getNumber()*i+UniversalEnum.EIGHT.getNumber()).setCellValue(ignored.getLostRate());
row.createCell(UniversalEnum.THREE.getNumber()).setCellValue(directionDescription);
row.createCell(UniversalEnum.FOUR.getNumber()).setCellValue(ignored.getProduction());
row.createCell(UniversalEnum.FIVE.getNumber()).setCellValue(ignored.getModel());
row.createCell(UniversalEnum.SIX.getNumber()).setCellValue(ignored.getContent());
}
row.createCell(UniversalEnum.TWO.getNumber() * i + UniversalEnum.SEVEN.getNumber()).setCellValue(ignored.getSuccessRate());
row.createCell(UniversalEnum.TWO.getNumber() * i + UniversalEnum.EIGHT.getNumber()).setCellValue(ignored.getLostRate());
}
i++;
flag = false;
//flag = false;
}
Sheet sheets = workbook.createSheet(UniversalEnum.DEVICE_FAILURE_RATE_SUMMARY_PAGE.getValue());
createSheet(sheets,categoryMap);
createSheet(sheets, categoryMap);
Sheet sheet1 = workbook.createSheet(UniversalEnum.EQUIPMENT_FAILURE_RATE_TIME_SHARING_SUMMARY_PAGE.getValue());
createSheet1(sheet1,ipMap);
createSheet1(sheet1, ipMap);
try (FileOutputStream outputStream = new FileOutputStream(filePath)) {
workbook.write(outputStream);
} catch (IOException e) {
@ -80,15 +89,16 @@ public class ExcelExportService {
System.out.println("excel写入成功!!!!!!");
}
public void createSheet1(Sheet sheet,Map<Integer, List<Status>> ipMap){
public void createSheet1(Sheet sheet, Map<Integer, List<Status>> ipMap) {
Map<Integer, List<Status>> map = new TreeMap<>(ipMap);
int rowNum = UniversalEnum.ZERO.getNumber();
Row row0 = sheet.createRow(rowNum);
row0.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(UniversalEnum.EQUIPMENT_CLASSIFICATION.getValue());
sheet.addMergedRegion(new CellRangeAddress(UniversalEnum.ZERO.getNumber(), UniversalEnum.ONE.getNumber(), UniversalEnum.ZERO.getNumber(), UniversalEnum.ZERO.getNumber()));
int i=UniversalEnum.ZERO.getNumber();
boolean flag = true;
Row row1= sheet.createRow(UniversalEnum.ONE.getNumber());
int i = UniversalEnum.ZERO.getNumber();
boolean flag = true;
Row row1 = sheet.createRow(UniversalEnum.ONE.getNumber());
for (Map.Entry<Integer, List<Status>> entry : map.entrySet()) {
row0.createCell(UniversalEnum.THREE.getNumber() * i + UniversalEnum.ONE.getNumber()).setCellValue(entry.getKey() + UniversalEnum.HOUR.getNumber());
sheet.addMergedRegion(new CellRangeAddress(UniversalEnum.ZERO.getNumber(), UniversalEnum.ZERO.getNumber(), UniversalEnum.THREE.getNumber() * i + UniversalEnum.ONE.getNumber(), UniversalEnum.THREE.getNumber() * i + UniversalEnum.THREE.getNumber()));
@ -102,46 +112,49 @@ public class ExcelExportService {
List<Status> groupItems = entrys.getValue();
long b = groupItems.stream().filter(iteam -> Objects.equals(iteam.getDeviceStatus(), UniversalEnum.ONE.getValue())).count();
// for (Status ignored : groupItems) {
int a = rowNum++;
Row row = sheet.getRow(a); // 获取指定索引的行
if (row == null) { // 如果行不存在,则创建新行
row = sheet.createRow(a);
}
HashMap<String, String> itemTypeMap = new HashMap<>();
itemTypeMap.put(UniversalEnum.ONE_ONE.getValue(), UniversalEnum.HD_NETWORK_GUN_TYPE_FIXED_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.ONE_TWO.getValue(), UniversalEnum.HD_NETWORK_SPHERICAL_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.ONE_THREE.getValue(), UniversalEnum.UNDER_THE_BRIDGE_HD_NETWORK_SPHERICAL_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.ONE_FOUR.getValue(), UniversalEnum.THREE_HUNDRED_SIXTY_PANORAMIC_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.ONE_FIVE.getValue(), UniversalEnum.ONE_HUNDRED_EIGHTY_PANORAMIC_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.TWO_ONE.getValue(), UniversalEnum.GANTRY_TYPE_VARIABLE_MESSAGE_SIGN.getValue());
itemTypeMap.put(UniversalEnum.TWO_THREE.getValue(), UniversalEnum.AWNING_VARIABLE_INFORMATION_SIGN.getValue());
itemTypeMap.put(UniversalEnum.TWO_FOUR.getValue(), UniversalEnum.CANTILEVER_VARIABLE_INFORMATION_SIGN_IN_FRONT_OF_STATION.getValue());
itemTypeMap.put(UniversalEnum.THREE.getValue(), UniversalEnum.METEOROLOGICAL_DETECTOR.getValue());
itemTypeMap.put(UniversalEnum.FIVE.getValue(), UniversalEnum.SECTION_VOICE_BROADCAST_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.SIX.getValue(), UniversalEnum.GUARDRAIL_COLLISION_WARNING_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.SEVEN.getValue(), UniversalEnum.MILLIMETER_WAVE_RADAR.getValue());
itemTypeMap.put(UniversalEnum.EIGHT.getValue(), UniversalEnum.CONFLUENCE_AREA_EARLY_WARNING_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.TEN.getValue(), UniversalEnum.LASER_FATIGUE_AWAKENING.getValue());
itemTypeMap.put(UniversalEnum.ELEVEN.getValue(), UniversalEnum.CLASS_I_TRAFFIC_SURVEY_STATION.getValue());
itemTypeMap.put(UniversalEnum.TWELVE.getValue(), UniversalEnum.INTELLIGENT_DRIVING_GUIDANCE_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.THIRTEEN.getValue(), UniversalEnum.SMART_DEVICE_BOX.getValue());
String type = groupItems.get(UniversalEnum.ZERO.getNumber()).getType();
String description = itemTypeMap.get(type);
if (flag) {
row.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(description);
}
row.createCell(UniversalEnum.THREE.getNumber() * i + UniversalEnum.ONE.getNumber()).setCellValue(groupItems.size());
row.createCell(UniversalEnum.THREE.getNumber() * i + UniversalEnum.TWO.getNumber()).setCellValue(b);
row.createCell(UniversalEnum.THREE.getNumber() * i + UniversalEnum.THREE.getNumber()).setCellValue(String.format("%.2f%%", (double) b / groupItems.size() * UniversalEnum.ONE_HUNDRED.getNumber()));
int a = rowNum++;
Row row = sheet.getRow(a); // 获取指定索引的行
if (row == null) { // 如果行不存在,则创建新行
row = sheet.createRow(a);
}
i++;
flag = false;
// }
HashMap<String, String> itemTypeMap = new HashMap<>();
itemTypeMap.put(UniversalEnum.ONE_ONE.getValue(), UniversalEnum.HD_NETWORK_GUN_TYPE_FIXED_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.ONE_TWO.getValue(), UniversalEnum.HD_NETWORK_SPHERICAL_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.ONE_THREE.getValue(), UniversalEnum.UNDER_THE_BRIDGE_HD_NETWORK_SPHERICAL_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.ONE_FOUR.getValue(), UniversalEnum.THREE_HUNDRED_SIXTY_PANORAMIC_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.ONE_FIVE.getValue(), UniversalEnum.ONE_HUNDRED_EIGHTY_PANORAMIC_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.TWO_ONE.getValue(), UniversalEnum.GANTRY_TYPE_VARIABLE_MESSAGE_SIGN.getValue());
itemTypeMap.put(UniversalEnum.TWO_TWO.getValue(), UniversalEnum.VARIABLE_MESSAGE_SIGN_IN_FRONT_OF_STATION.getValue());
itemTypeMap.put(UniversalEnum.TWO_THREE.getValue(), UniversalEnum.AWNING_VARIABLE_INFORMATION_SIGN.getValue());
itemTypeMap.put(UniversalEnum.TWO_FOUR.getValue(), UniversalEnum.CANTILEVER_VARIABLE_INFORMATION_SIGN_IN_FRONT_OF_STATION.getValue());
itemTypeMap.put(UniversalEnum.THREE.getValue(), UniversalEnum.METEOROLOGICAL_DETECTOR.getValue());
itemTypeMap.put(UniversalEnum.FIVE.getValue(), UniversalEnum.SECTION_VOICE_BROADCAST_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.SIX.getValue(), UniversalEnum.GUARDRAIL_COLLISION_WARNING_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.SEVEN.getValue(), UniversalEnum.MILLIMETER_WAVE_RADAR.getValue());
itemTypeMap.put(UniversalEnum.EIGHT.getValue(), UniversalEnum.CONFLUENCE_AREA_EARLY_WARNING_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.TEN.getValue(), UniversalEnum.LASER_FATIGUE_AWAKENING.getValue());
itemTypeMap.put(UniversalEnum.ELEVEN.getValue(), UniversalEnum.CLASS_I_TRAFFIC_SURVEY_STATION.getValue());
itemTypeMap.put(UniversalEnum.TWELVE.getValue(), UniversalEnum.INTELLIGENT_DRIVING_GUIDANCE_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.THIRTEEN.getValue(), UniversalEnum.SMART_DEVICE_BOX.getValue());
itemTypeMap.put(UniversalEnum.FIFTEEN.getValue(), UniversalEnum.SOLAR_PANEL.getValue());
itemTypeMap.put(UniversalEnum.SIXTEEN.getValue(), UniversalEnum.REMOTE_COMPUTER.getValue());
String type = groupItems.get(UniversalEnum.ZERO.getNumber()).getType();
String description = itemTypeMap.get(type);
if (flag) {
row.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(description);
}
row.createCell(UniversalEnum.THREE.getNumber() * i + UniversalEnum.ONE.getNumber()).setCellValue(groupItems.size());
row.createCell(UniversalEnum.THREE.getNumber() * i + UniversalEnum.TWO.getNumber()).setCellValue(b);
row.createCell(UniversalEnum.THREE.getNumber() * i + UniversalEnum.THREE.getNumber()).setCellValue(String.format("%.2f%%", (double) b / groupItems.size() * UniversalEnum.ONE_HUNDRED.getNumber()));
}
i++;
flag = false;
// }
}
}
public void createSheet(Sheet sheet,Map<String, List<Status> >categoryMap){
public void createSheet(Sheet sheet, Map<String, List<Status>> categoryMap) {
int rowNum = UniversalEnum.ZERO.getNumber();
Row row = sheet.createRow(rowNum);
row.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(UniversalEnum.EQUIPMENT_CLASSIFICATION.getValue());
@ -151,40 +164,40 @@ public class ExcelExportService {
rowNum = UniversalEnum.ONE.getNumber();
for (Map.Entry<String, List<Status>> entry : categoryMap.entrySet()) {
List<Status> groupItems = entry.getValue();
long a=groupItems.stream().filter(iteam-> Objects.equals(iteam.getDeviceStatus(), UniversalEnum.ONE.getValue())).count();
row = sheet.createRow(rowNum++);
long a = groupItems.stream().filter(iteam -> Objects.equals(iteam.getDeviceStatus(), UniversalEnum.ONE.getValue())).count();
row = sheet.createRow(rowNum++);
HashMap<String, String> itemTypeMap = new HashMap<>();
itemTypeMap.put(UniversalEnum.ONE.getValue(), UniversalEnum.HD_NETWORK_GUN_TYPE_FIXED_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.TWO.getValue(), UniversalEnum.HD_NETWORK_SPHERICAL_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.THREE.getValue(), UniversalEnum.UNDER_THE_BRIDGE_HD_NETWORK_SPHERICAL_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.FOUR.getValue(), UniversalEnum.THREE_HUNDRED_SIXTY_PANORAMIC_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.FIVE.getValue(), UniversalEnum.ONE_HUNDRED_EIGHTY_PANORAMIC_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.SIX.getValue(), UniversalEnum.GANTRY_TYPE_VARIABLE_MESSAGE_SIGN.getValue());
itemTypeMap.put(UniversalEnum.SEVEN.getValue(), UniversalEnum.AWNING_VARIABLE_INFORMATION_SIGN.getValue());
itemTypeMap.put(UniversalEnum.EIGHT.getValue(), UniversalEnum.CANTILEVER_VARIABLE_INFORMATION_SIGN_IN_FRONT_OF_STATION.getValue());
itemTypeMap.put(UniversalEnum.NINE.getValue(), UniversalEnum.METEOROLOGICAL_DETECTOR.getValue());
itemTypeMap.put(UniversalEnum.TEN.getValue(), UniversalEnum.SECTION_VOICE_BROADCAST_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.ELEVEN.getValue(), UniversalEnum.GUARDRAIL_COLLISION_WARNING_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.TWELVE.getValue(), UniversalEnum.MILLIMETER_WAVE_RADAR.getValue());
itemTypeMap.put(UniversalEnum.THIRTEEN.getValue(), UniversalEnum.CONFLUENCE_AREA_EARLY_WARNING_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.FOURTEEN.getValue(), UniversalEnum.LASER_FATIGUE_AWAKENING.getValue());
itemTypeMap.put(UniversalEnum.FIFTEEN.getValue(), UniversalEnum.CLASS_I_TRAFFIC_SURVEY_STATION.getValue());
itemTypeMap.put(UniversalEnum.SIXTEEN.getValue(), UniversalEnum.INTELLIGENT_DRIVING_GUIDANCE_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.SEVENTEEN.getValue(), UniversalEnum.SMART_DEVICE_BOX.getValue());
itemTypeMap.put(UniversalEnum.ONE_ONE.getValue(), UniversalEnum.HD_NETWORK_GUN_TYPE_FIXED_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.ONE_TWO.getValue(), UniversalEnum.HD_NETWORK_SPHERICAL_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.ONE_THREE.getValue(), UniversalEnum.UNDER_THE_BRIDGE_HD_NETWORK_SPHERICAL_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.ONE_FOUR.getValue(), UniversalEnum.THREE_HUNDRED_SIXTY_PANORAMIC_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.ONE_FIVE.getValue(), UniversalEnum.ONE_HUNDRED_EIGHTY_PANORAMIC_CAMERA.getValue());
itemTypeMap.put(UniversalEnum.TWO_ONE.getValue(), UniversalEnum.GANTRY_TYPE_VARIABLE_MESSAGE_SIGN.getValue());
itemTypeMap.put(UniversalEnum.TWO_TWO.getValue(), UniversalEnum.VARIABLE_MESSAGE_SIGN_IN_FRONT_OF_STATION.getValue());
itemTypeMap.put(UniversalEnum.TWO_THREE.getValue(), UniversalEnum.AWNING_VARIABLE_INFORMATION_SIGN.getValue());
itemTypeMap.put(UniversalEnum.TWO_FOUR.getValue(), UniversalEnum.CANTILEVER_VARIABLE_INFORMATION_SIGN_IN_FRONT_OF_STATION.getValue());
itemTypeMap.put(UniversalEnum.THREE.getValue(), UniversalEnum.METEOROLOGICAL_DETECTOR.getValue());
itemTypeMap.put(UniversalEnum.FIVE.getValue(), UniversalEnum.SECTION_VOICE_BROADCAST_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.SIX.getValue(), UniversalEnum.GUARDRAIL_COLLISION_WARNING_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.SEVEN.getValue(), UniversalEnum.MILLIMETER_WAVE_RADAR.getValue());
itemTypeMap.put(UniversalEnum.EIGHT.getValue(), UniversalEnum.CONFLUENCE_AREA_EARLY_WARNING_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.TEN.getValue(), UniversalEnum.LASER_FATIGUE_AWAKENING.getValue());
itemTypeMap.put(UniversalEnum.ELEVEN.getValue(), UniversalEnum.CLASS_I_TRAFFIC_SURVEY_STATION.getValue());
itemTypeMap.put(UniversalEnum.TWELVE.getValue(), UniversalEnum.INTELLIGENT_DRIVING_GUIDANCE_SYSTEM.getValue());
itemTypeMap.put(UniversalEnum.THIRTEEN.getValue(), UniversalEnum.SMART_DEVICE_BOX.getValue());
itemTypeMap.put(UniversalEnum.FIFTEEN.getValue(), UniversalEnum.SOLAR_PANEL.getValue());
itemTypeMap.put(UniversalEnum.SIXTEEN.getValue(), UniversalEnum.REMOTE_COMPUTER.getValue());
String type = groupItems.get(UniversalEnum.ZERO.getNumber()).getType();
String description = itemTypeMap.get(type);
row.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(description);
row.createCell(UniversalEnum.ONE.getNumber()).setCellValue(groupItems.size());
row.createCell(UniversalEnum.TWO.getNumber()).setCellValue(a);
row.createCell(UniversalEnum.THREE.getNumber()).setCellValue(String.format("%.2f%%", (double) a / groupItems.size() * UniversalEnum.ONE_HUNDRED.getNumber()));
row.createCell(UniversalEnum.ZERO.getNumber()).setCellValue(description);
row.createCell(UniversalEnum.ONE.getNumber()).setCellValue(groupItems.size());
row.createCell(UniversalEnum.TWO.getNumber()).setCellValue(a);
row.createCell(UniversalEnum.THREE.getNumber()).setCellValue(String.format("%.2f%%", (double) a / groupItems.size() * UniversalEnum.ONE_HUNDRED.getNumber()));
}
}
}

Loading…
Cancel
Save