Browse Source

导出代码修整

develop
wangsixiang 2 months ago
parent
commit
253816e16f
  1. 34
      zc-business/src/main/java/com/zc/business/service/impl/DcSdhsEventServiceImpl.java

34
zc-business/src/main/java/com/zc/business/service/impl/DcSdhsEventServiceImpl.java

@ -316,7 +316,7 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService {
Map<String, Object> row = new HashMap<>();
row.put("stakeMark", stakeMark);
row.put(thisTime, thisTimeValue);
row.put(lastTime, lastTimeList.getOrDefault(stakeMark, "0.00"));
row.put(lastTime, lastTimeList.getOrDefault(stakeMark, "0"));
sortedResult.add(row);
}
// 添加那些只在lastTimeList中的键
@ -428,8 +428,8 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService {
//excel
for (int i = 0; i < maps.size(); i++) {
setTableFonts(table.getRow(i + 1).getCell(0), maps.get(i).get("stakeMark").toString());
setTableFonts(table.getRow(i + 1).getCell(1), maps.get(i).get("thisTimeList").toString());
setTableFonts(table.getRow(i + 1).getCell(2), maps.get(i).get("lastTimeList").toString());
setTableFonts(table.getRow(i + 1).getCell(1), maps.get(i).get(dcSdhsEventQuery.getThisTime()).toString());
setTableFonts(table.getRow(i + 1).getCell(2), maps.get(i).get(dcSdhsEventQuery.getLastTime()).toString());
}
try{
// 复制Word模板
@ -445,8 +445,8 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService {
//分类信息
for (int i = UniversalEnum.ZERO.getNumber(); i < maps.size(); i++){
sheet.getRow(i + 1).getCell(0).setCellValue(maps.get(i).get("stakeMark").toString());
sheet.getRow(i + 1).getCell(1).setCellValue(Long.parseLong(maps.get(i).get("thisTimeList").toString()));
sheet.getRow(i + 1).getCell(2).setCellValue(Long.parseLong(maps.get(i).get("lastTimeList").toString()));
sheet.getRow(i + 1).getCell(1).setCellValue(Long.parseLong(maps.get(i).get(dcSdhsEventQuery.getThisTime()).toString()));
sheet.getRow(i + 1).getCell(2).setCellValue(Long.parseLong(maps.get(i).get(dcSdhsEventQuery.getLastTime()).toString()));
}
for (int i = sheet.getLastRowNum(); i > maps.size();i--){
sheet.removeRow(sheet.getRow(i));
@ -484,8 +484,8 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService {
//excel
for (int i = UniversalEnum.ZERO.getNumber(); i < maps.size(); i++) {
setTableFonts(table.getRow(i + 1).getCell(0), maps.get(i).get("eventType").toString());
setTableFonts(table.getRow(i + 1).getCell(1), maps.get(i).get("thisTimeList").toString());
setTableFonts(table.getRow(i + 1).getCell(2), maps.get(i).get("lastTimeList").toString());
setTableFonts(table.getRow(i + 1).getCell(1), maps.get(i).get(dcSdhsEventQuery.getThisTime()).toString());
setTableFonts(table.getRow(i + 1).getCell(2), maps.get(i).get(dcSdhsEventQuery.getLastTime()).toString());
}
try {
// 复制Word模板
@ -502,8 +502,8 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService {
//分类信息
for (int i = UniversalEnum.ZERO.getNumber(); i < maps.size(); i++) {
sheet.getRow(i + 1).getCell(0).setCellValue(maps.get(i).get("eventType").toString());
sheet.getRow(i + 1).getCell(1).setCellValue(Long.parseLong(maps.get(i).get("thisTimeList").toString()));
sheet.getRow(i + 1).getCell(2).setCellValue(Long.parseLong(maps.get(i).get("lastTimeList").toString()));
sheet.getRow(i + 1).getCell(1).setCellValue(Long.parseLong(maps.get(i).get(dcSdhsEventQuery.getThisTime()).toString()));
sheet.getRow(i + 1).getCell(2).setCellValue(Long.parseLong(maps.get(i).get(dcSdhsEventQuery.getLastTime()).toString()));
}
for (int i = sheet.getLastRowNum(); i > maps.size(); i--) {
sheet.removeRow(sheet.getRow(i));
@ -541,8 +541,8 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService {
//excel
for (int i = 0; i < maps.size(); i++) {
setTableFonts(table.getRow(i + 1).getCell(0), maps.get(i).get("stakeMark").toString());
setTableFonts(table.getRow(i + 1).getCell(1), maps.get(i).get("thisTimeList").toString());
setTableFonts(table.getRow(i + 1).getCell(2), maps.get(i).get("lastTimeList").toString());
setTableFonts(table.getRow(i + 1).getCell(1), maps.get(i).get(dcSdhsEventQuery.getThisTime()).toString());
setTableFonts(table.getRow(i + 1).getCell(2), maps.get(i).get(dcSdhsEventQuery.getLastTime()).toString());
}
try{
// 复制Word模板
@ -558,8 +558,8 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService {
//分类信息
for (int i = UniversalEnum.ZERO.getNumber(); i < maps.size(); i++){
sheet.getRow(i + 1).getCell(0).setCellValue(maps.get(i).get("stakeMark").toString());
sheet.getRow(i + 1).getCell(1).setCellValue(Double.valueOf(maps.get(i).get("thisTimeList").toString()));
sheet.getRow(i + 1).getCell(2).setCellValue(Double.valueOf(maps.get(i).get("lastTimeList").toString()));
sheet.getRow(i + 1).getCell(1).setCellValue(Math.round(Double.valueOf(maps.get(i).get(dcSdhsEventQuery.getThisTime()).toString())));
sheet.getRow(i + 1).getCell(2).setCellValue(Math.round(Double.valueOf(maps.get(i).get(dcSdhsEventQuery.getLastTime()).toString())));
}
for (int i = sheet.getLastRowNum(); i > maps.size();i--){
sheet.removeRow(sheet.getRow(i));
@ -596,8 +596,8 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService {
//excel
for (int i = UniversalEnum.ZERO.getNumber(); i < maps.size(); i++) {
setTableFonts(table.getRow(i + 1).getCell(0), maps.get(i).get("eventSubclass").toString());
setTableFonts(table.getRow(i + 1).getCell(1), maps.get(i).get("thisTimeList").toString());
setTableFonts(table.getRow(i + 1).getCell(2), maps.get(i).get("lastTimeList").toString());
setTableFonts(table.getRow(i + 1).getCell(1), maps.get(i).get(dcSdhsEventQuery.getThisTime()).toString());
setTableFonts(table.getRow(i + 1).getCell(2), maps.get(i).get(dcSdhsEventQuery.getLastTime()).toString());
}
try {
// 复制Word模板
@ -614,8 +614,8 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService {
//分类信息
for (int i = UniversalEnum.ZERO.getNumber(); i < maps.size(); i++) {
sheet.getRow(i + 1).getCell(0).setCellValue(maps.get(i).get("eventSubclass").toString());
sheet.getRow(i + 1).getCell(1).setCellValue(Long.parseLong(maps.get(i).get("thisTimeList").toString()));
sheet.getRow(i + 1).getCell(2).setCellValue(Long.parseLong(maps.get(i).get("lastTimeList").toString()));
sheet.getRow(i + 1).getCell(1).setCellValue(Long.parseLong(maps.get(i).get(dcSdhsEventQuery.getThisTime()).toString()));
sheet.getRow(i + 1).getCell(2).setCellValue(Long.parseLong(maps.get(i).get(dcSdhsEventQuery.getLastTime()).toString()));
}
for (int i = sheet.getLastRowNum(); i > maps.size();i--){
sheet.removeRow(sheet.getRow(i));

Loading…
Cancel
Save