yangys
2024-03-27 e48aa2ac8dea1be5db11c63edf0b912c4ad5ce65
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
package com.qianwen.smartman.common.utils;
 
import java.awt.Color;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFColor;
import org.apache.poi.xssf.usermodel.XSSFFont;
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.qianwen.smartman.common.constant.ExcelConstant;
import com.qianwen.core.tool.utils.Func;
import com.qianwen.smartman.modules.coproduction.dto.CheckResultDTO;
 
public class ExcelUtils {
    /* JADX WARN: Multi-variable type inference failed */
    public static ExcelDataDTO readExcel(InputStream inputStream) {
        XSSFWorkbook xSSFWorkbook = null;
        Workbook workBook = null;
        ExcelDataDTO excelDataDTO = buildDataDTO();
        try {
          xSSFWorkbook = new XSSFWorkbook(inputStream);
          ByteArrayOutputStream bos = new ByteArrayOutputStream();
          xSSFWorkbook.write(bos);
          excelDataDTO.setBytes(bos.toByteArray());
          Sheet sheet = xSSFWorkbook.getSheetAt(0);
          int lastRowNum = sheet.getLastRowNum();
          Row rowHead = sheet.getRow(1);
          int lastCellNum = rowHead.getLastCellNum();
          for (int j = 0; j < lastCellNum; j++) {
            String value = rowHead.getCell(j).getStringCellValue();
            excelDataDTO.addHead(value);
          } 
          List<String> heads = excelDataDTO.getHeads();
          Integer index = Integer.valueOf(0);
          for (int i = 2; i <= lastRowNum; i++) {
            Row row = sheet.getRow(i);
            for (int k = 0; k < lastCellNum; k++) {
              String head = heads.get(k);
              Cell cell = row.getCell(k);
              String value = getCellValue(cell);
              excelDataDTO.setData(index, head, value);
            } 
            Integer integer1 = index, integer2 = index = Integer.valueOf(index.intValue() + 1);
          } 
        } catch (IOException e) {
          e.printStackTrace();
        } finally {
          if (xSSFWorkbook != null)
            try {
              xSSFWorkbook.close();
            } catch (IOException e) {
              e.printStackTrace();
            }  
          if (inputStream != null)
            try {
              inputStream.close();
            } catch (IOException e) {
              e.printStackTrace();
            }  
        } 
        return excelDataDTO;
        
        /*
        Workbook workBook = null;
        ExcelDataDTO excelDataDTO = buildDataDTO();
        try {
            try {
                workBook = new XSSFWorkbook(inputStream);
                ByteArrayOutputStream bos = new ByteArrayOutputStream();
                workBook.write(bos);
                excelDataDTO.setBytes(bos.toByteArray());
                Sheet sheet = workBook.getSheetAt(0);
                int lastRowNum = sheet.getLastRowNum();
                Row rowHead = sheet.getRow(1);
                int lastCellNum = rowHead.getLastCellNum();
                for (int j = 0; j < lastCellNum; j++) {
                    String value = rowHead.getCell(j).getStringCellValue();
                    excelDataDTO.addHead(value);
                }
                List<String> heads = excelDataDTO.getHeads();
                Integer index = 0;
                for (int i = 2; i <= lastRowNum; i++) {
                    Row row = sheet.getRow(i);
                    for (int j2 = 0; j2 < lastCellNum; j2++) {
                        String head = heads.get(j2);
                        Cell cell = row.getCell(j2);
                        String value2 = getCellValue(cell);
                        excelDataDTO.setData(index, head, value2);
                    }
                    index = Integer.valueOf(index.intValue() + 1);
                }
                if (workBook != null) {
                    try {
                        workBook.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
                if (inputStream != null) {
                    try {
                        inputStream.close();
                    } catch (IOException e2) {
                        e2.printStackTrace();
                    }
                }
            } catch (IOException e3) {
                e3.printStackTrace();
                if (workBook != null) {
                    try {
                        workBook.close();
                    } catch (IOException e4) {
                        e4.printStackTrace();
                    }
                }
                if (inputStream != null) {
                    try {
                        inputStream.close();
                    } catch (IOException e5) {
                        e5.printStackTrace();
                    }
                }
            }
            return excelDataDTO;
        } catch (Throwable th) {
            if (workBook != null) {
                try {
                    workBook.close();
                } catch (IOException e6) {
                    e6.printStackTrace();
                }
            }
            if (inputStream != null) {
                try {
                    inputStream.close();
                } catch (IOException e7) {
                    e7.printStackTrace();
                }
            }
            throw th;
        }
        */
    }
 
    private static String getCellValue(Cell cell) {
        String s2;
        if (Func.isEmpty(cell)) {
          return ""; 
        }
        String data = "";
        CellType cellType = cell.getCellTypeEnum();
        switch (cellType) {
          case _NONE:
            data = null;
            return data;
          case STRING:
            data = cell.getStringCellValue();
            return data;
          case NUMERIC:
            if (DateUtil.isCellDateFormatted(cell)) {
              Date date = cell.getDateCellValue();
              return com.qianwen.core.tool.utils.DateUtil.DATETIME_FORMAT.format(date);
            } 
            s2 = (new DecimalFormat("#.###########")).format(cell.getNumericCellValue());
            data = (new BigDecimal(s2)).stripTrailingZeros().toPlainString();
            return data;
        } 
        data = "";
        return data;
        
        /*
        String data;
        if (Func.isEmpty(cell)) {
            return "";
        }
        CellType cellType = cell.getCellTypeEnum();
        switch (AnonymousClass1.$SwitchMap$org$apache$poi$ss$usermodel$CellType[cellType.ordinal()]) {
            case 1:
                data = null;
                break;
            case 2:
                data = cell.getStringCellValue();
                break;
            case 3:
                if (DateUtil.isCellDateFormatted(cell)) {
                    Date date = cell.getDateCellValue();
                    return org.springblade.core.tool.utils.DateUtil.DATETIME_FORMAT.format(date);
                }
                String s2 = new DecimalFormat("#.###########").format(cell.getNumericCellValue());
                data = new BigDecimal(s2).stripTrailingZeros().toPlainString();
                break;
            default:
                data = "";
                break;
        }
        return data;
        */
    }
 
 
    public static Workbook generateFail(ExcelDataDTO excelDataDTO) {
        List<Map<String, String>> data = excelDataDTO.getData();
        XSSFWorkbook workBook = null;
        byte[] bytes = excelDataDTO.getBytes();
        InputStream inputStream = new ByteArrayInputStream(bytes);
        try {
            workBook = new XSSFWorkbook(inputStream);
            XSSFSheet sheetAt = workBook.getSheetAt(0);
            int lastRowNum = sheetAt.getLastRowNum();
            Row rowHead = sheetAt.getRow(1);
            int lastCellNum = rowHead.getLastCellNum();
            Cell headCell = rowHead.createCell(lastCellNum);
            headCell.setCellStyle(baseHeadStyle(workBook));
            headCell.setCellValue(ExcelConstant.FAIL_REASON);
            List<Integer> rowNums = new ArrayList<>();
            for (int i = 2; i <= lastRowNum; i++) {
                Row row = sheetAt.getRow(i);
                Cell cell = row.createCell(lastCellNum);
                cell.setCellStyle(baseStyle(workBook));
                Map<String, String> map = data.get(i - 2);
                if (map.containsKey(ExcelConstant.FAIL_REASON)) {
                    cell.setCellValue(map.get(ExcelConstant.FAIL_REASON));
                } else {
                    rowNums.add(Integer.valueOf(i + 1));
                }
            }
            if (Func.isNotEmpty(rowNums)) {
                for (int i2 = sheetAt.getLastRowNum(); i2 <= ((Integer) Collections.max(rowNums)).intValue(); i2++) {
                    sheetAt.createRow(i2);
                }
                rowNums.forEach(item -> {
                    sheetAt.shiftRows(item.intValue(), sheetAt.getLastRowNum(), -1);
                });
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return workBook;
    }
 
    public static Workbook generateExport(ExcelExportDTO excelExportDTO) {
        List<Header> tableHeader = excelExportDTO.getTableHeader();
        List<Map<String, String>> data = excelExportDTO.getData();
        XSSFWorkbook workbook = new XSSFWorkbook();
        XSSFCellStyle cellStyle = workbook.createCellStyle();
        cellStyle.setWrapText(true);
        XSSFSheet sheet = workbook.createSheet();
        XSSFRow row = sheet.createRow(0);
        int cellNum = 0;
        Map<String, Integer> cellNumMap = new HashMap<>();
        for (Header header : tableHeader) {
            String text = header.getText();
            sheet.setColumnWidth(cellNum, text.getBytes().length * 512);
            XSSFCell head = row.createCell(cellNum);
            head.setCellValue(text);
            if (header.isRequired()) {
                head.setCellStyle(exportHeadStyle(workbook));
            } else {
                head.setCellStyle(exportHeadStyle(workbook));
            }
            cellNumMap.put(text, Integer.valueOf(cellNum));
            cellNum++;
        }
        for (int i = 0; i < data.size(); i++) {
            XSSFRow dataRow = sheet.createRow(1 + i);
            Map<String, String> item = data.get(i);
            item.forEach((key, value) -> {
                Integer dataNum = (Integer) cellNumMap.get(key);
                XSSFCell cell = dataRow.createCell(dataNum.intValue());
                cell.setCellValue(value);
                cell.setCellStyle(baseStyle(workbook));
 
            });
        }
        return workbook;
    }
 
    public static Workbook generateTemplate(ExcelTemplateDTO excelTemplateDTO) {
        List<RemindLine> remind = excelTemplateDTO.getRemind();
        List<Header> tableHeader = excelTemplateDTO.getTableHeader();
        int sumLine = tableHeader.size() - 1;
        XSSFWorkbook workbook = new XSSFWorkbook();
        XSSFCellStyle cellStyle = workbook.createCellStyle();
        cellStyle.setWrapText(true);
        XSSFSheet sheet = workbook.createSheet();
        XSSFRow row = sheet.createRow(0);
        row.setHeightInPoints((18 * remind.size()) + 30);
        XSSFCell cell = row.createCell(0);
        CellRangeAddress region = new CellRangeAddress(0, 0, 0, sumLine);
        sheet.addMergedRegion(region);
        cell.setCellStyle(cellStyle);
        StringBuilder sb = new StringBuilder();
        for (RemindLine remindLine : remind) {
            sb.append(remindLine.getText()).append("\n");
        }
        XSSFRichTextString ts = new XSSFRichTextString(sb.toString());
        int count = 0;
        for (RemindLine remindLine2 : remind) {
            int temp = count + remindLine2.getText().length() + 1;
            if (remindLine2.isRed()) {
                ts.applyFont(count, temp, redBaseFont(workbook));
            } else {
                ts.applyFont(count, temp, blackBaseFont(workbook));
            }
            count = temp;
        }
        cell.setCellValue(ts);
        XSSFRow row2 = sheet.createRow(1);
        int cellNum = 0;
        for (Header header : tableHeader) {
            String text = header.getText();
            sheet.setColumnWidth(cellNum, text.getBytes().length * 512);
            XSSFCell head = row2.createCell(cellNum);
            head.setCellValue(text);
            if (header.isRequired()) {
                head.setCellStyle(requiredHeadStyle(workbook));
            } else {
                head.setCellStyle(baseHeadStyle(workbook));
            }
            cellNum++;
        }
        return workbook;
    }
 
    public static CellStyle baseStyle(XSSFWorkbook workbook) {
        XSSFCellStyle createCellStyle = workbook.createCellStyle();
        createCellStyle.setDataFormat(workbook.createDataFormat().getFormat("@"));
        createCellStyle.setFont(blackBaseFont(workbook));
        return createCellStyle;
    }
 
    public static CellStyle requiredHeadStyle(XSSFWorkbook workbook) {
        XSSFCellStyle styleRequired = workbook.createCellStyle();
        styleRequired.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        styleRequired.setFillForegroundColor(new XSSFColor(new Color(192, 0, 0)));
        styleRequired.setDataFormat(workbook.createDataFormat().getFormat("@"));
        styleRequired.setFont(headFont(workbook));
        return styleRequired;
    }
 
    public static CellStyle baseHeadStyle(XSSFWorkbook workbook) {
        XSSFCellStyle baseRequired = workbook.createCellStyle();
        baseRequired.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        baseRequired.setFillForegroundColor(new XSSFColor(new Color(64, 64, 64)));
        baseRequired.setDataFormat(workbook.createDataFormat().getFormat("@"));
        baseRequired.setFont(headFont(workbook));
        return baseRequired;
    }
 
    public static CellStyle exportHeadStyle(XSSFWorkbook workbook) {
        XSSFCellStyle baseRequired = workbook.createCellStyle();
        baseRequired.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        baseRequired.setFillForegroundColor(new XSSFColor(new Color(192, 192, 192)));
        baseRequired.setDataFormat(workbook.createDataFormat().getFormat("@"));
        baseRequired.setFont(headBoldBaseFont(workbook));
        return baseRequired;
    }
 
    public static Font headFont(XSSFWorkbook workbook) {
        XSSFFont createFont = workbook.createFont();
        createFont.setColor(IndexedColors.WHITE.getIndex());
        createFont.setFontHeightInPoints((short) 12);
        createFont.setFontName("微软雅黑");
        return createFont;
    }
 
    public static Font redBaseFont(XSSFWorkbook workbook) {
        XSSFFont font = workbook.createFont();
        font.setColor(new XSSFColor(new Color(255, 0, 0)));
        font.setFontHeightInPoints((short) 12);
        font.setFontName("微软雅黑");
        return font;
    }
 
    public static Font blackBaseFont(XSSFWorkbook workbook) {
        XSSFFont createFont = workbook.createFont();
        createFont.setColor(IndexedColors.BLACK.getIndex());
        createFont.setFontHeightInPoints((short) 12);
        createFont.setFontName("微软雅黑");
        return createFont;
    }
 
    public static Font headBoldBaseFont(XSSFWorkbook workbook) {
        XSSFFont createFont = workbook.createFont();
        createFont.setColor(IndexedColors.BLACK.getIndex());
        createFont.setFontHeightInPoints((short) 14);
        createFont.setBold(true);
        createFont.setFontName("微软雅黑");
        return createFont;
    }
 
    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/common/utils/ExcelUtils$RemindLine.class */
    public static class RemindLine {
        private String text;
        private boolean red;
        private boolean bold;
 
        public void setText(final String text) {
            this.text = text;
        }
 
        public void setRed(final boolean red) {
            this.red = red;
        }
 
        public void setBold(final boolean bold) {
            this.bold = bold;
        }
 
        public boolean equals(final Object o) {
            if (o == this) {
                return true;
            }
            if (o instanceof RemindLine) {
                RemindLine other = (RemindLine) o;
                if (other.canEqual(this) && isRed() == other.isRed() && isBold() == other.isBold()) {
                    Object this$text = getText();
                    Object other$text = other.getText();
                    return this$text == null ? other$text == null : this$text.equals(other$text);
                }
                return false;
            }
            return false;
        }
 
        protected boolean canEqual(final Object other) {
            return other instanceof RemindLine;
        }
 
        public int hashCode() {
            int result = (1 * 59) + (isRed() ? 79 : 97);
            int result2 = (result * 59) + (isBold() ? 79 : 97);
            Object $text = getText();
            return (result2 * 59) + ($text == null ? 43 : $text.hashCode());
        }
 
        public String toString() {
            return "ExcelUtils.RemindLine(text=" + getText() + ", red=" + isRed() + ", bold=" + isBold() + ")";
        }
 
        public RemindLine(final String text, final boolean red, final boolean bold) {
            this.text = text;
            this.red = red;
            this.bold = bold;
        }
 
        public String getText() {
            return this.text;
        }
 
        public boolean isRed() {
            return this.red;
        }
 
        public boolean isBold() {
            return this.bold;
        }
    }
 
    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/common/utils/ExcelUtils$Header.class */
    public static class Header {
        private String text;
        private boolean required;
 
        public void setText(final String text) {
            this.text = text;
        }
 
        public void setRequired(final boolean required) {
            this.required = required;
        }
 
        public boolean equals(final Object o) {
            if (o == this) {
                return true;
            }
            if (o instanceof Header) {
                Header other = (Header) o;
                if (other.canEqual(this) && isRequired() == other.isRequired()) {
                    Object this$text = getText();
                    Object other$text = other.getText();
                    return this$text == null ? other$text == null : this$text.equals(other$text);
                }
                return false;
            }
            return false;
        }
 
        protected boolean canEqual(final Object other) {
            return other instanceof Header;
        }
 
        public int hashCode() {
            int result = (1 * 59) + (isRequired() ? 79 : 97);
            Object $text = getText();
            return (result * 59) + ($text == null ? 43 : $text.hashCode());
        }
 
        public String toString() {
            return "ExcelUtils.Header(text=" + getText() + ", required=" + isRequired() + ")";
        }
 
        public Header(final String text, final boolean required) {
            this.text = text;
            this.required = required;
        }
 
        public String getText() {
            return this.text;
        }
 
        public boolean isRequired() {
            return this.required;
        }
    }
 
    /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/common/utils/ExcelUtils$ExcelExportDTO.class */
    public static class ExcelExportDTO {
        private final List<Header> tableHeader = new ArrayList();
        private List<Map<String, String>> data = new ArrayList();
 
        public void setData(final List<Map<String, String>> data) {
            this.data = data;
        }
 
        public boolean equals(final Object o) {
            if (o == this) {
                return true;
            }
            if (o instanceof ExcelExportDTO) {
                ExcelExportDTO other = (ExcelExportDTO) o;
                if (other.canEqual(this)) {
                    Object this$tableHeader = getTableHeader();
                    Object other$tableHeader = other.getTableHeader();
                    if (this$tableHeader == null) {
                        if (other$tableHeader != null) {
                            return false;
                        }
                    } else if (!this$tableHeader.equals(other$tableHeader)) {
                        return false;
                    }
                    Object this$data = getData();
                    Object other$data = other.getData();
                    return this$data == null ? other$data == null : this$data.equals(other$data);
                }
                return false;
            }
            return false;
        }
 
        protected boolean canEqual(final Object other) {
            return other instanceof ExcelExportDTO;
        }
 
        public int hashCode() {
            Object $tableHeader = getTableHeader();
            int result = (1 * 59) + ($tableHeader == null ? 43 : $tableHeader.hashCode());
            Object $data = getData();
            return (result * 59) + ($data == null ? 43 : $data.hashCode());
        }
 
        public String toString() {
            return "ExcelUtils.ExcelExportDTO(tableHeader=" + getTableHeader() + ", data=" + getData() + ")";
        }
 
        public List<Header> getTableHeader() {
            return this.tableHeader;
        }
 
        public List<Map<String, String>> getData() {
            return this.data;
        }
 
        public ExcelExportDTO addTableHead(String text, boolean required) {
            this.tableHeader.add(new Header(text, required));
            return this;
        }
 
        public ExcelExportDTO addData(Map<String, String> item) {
            this.data.add(item);
            return this;
        }
    }
 
    /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/common/utils/ExcelUtils$ExcelTemplateDTO.class */
    public static class ExcelTemplateDTO {
        private final List<RemindLine> remind = new ArrayList();
        private final List<Header> tableHeader = new ArrayList();
 
        public List<RemindLine> getRemind() {
            return this.remind;
        }
 
        public List<Header> getTableHeader() {
            return this.tableHeader;
        }
 
        public ExcelTemplateDTO appendRemind(String text, boolean isRed, boolean bold) {
            this.remind.add(new RemindLine(text, isRed, bold));
            return this;
        }
 
        public ExcelTemplateDTO addTableHead(String text, boolean required) {
            this.tableHeader.add(new Header(text, required));
            return this;
        }
    }
 
    /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/common/utils/ExcelUtils$ExcelDataDTO.class */
    public static class ExcelDataDTO {
        private List<String> heads = new ArrayList();
        private List<Map<String, String>> data = new ArrayList();
        private List<CheckResultDTO> checkResultDTOS;
        private byte[] bytes;
 
        public void setHeads(final List<String> heads) {
            this.heads = heads;
        }
 
        public void setData(final List<Map<String, String>> data) {
            this.data = data;
        }
 
        public void setCheckResultDTOS(final List<CheckResultDTO> checkResultDTOS) {
            this.checkResultDTOS = checkResultDTOS;
        }
 
        public void setBytes(final byte[] bytes) {
            this.bytes = bytes;
        }
 
        public boolean equals(final Object o) {
            if (o == this) {
                return true;
            }
            if (o instanceof ExcelDataDTO) {
                ExcelDataDTO other = (ExcelDataDTO) o;
                if (other.canEqual(this)) {
                    Object this$heads = getHeads();
                    Object other$heads = other.getHeads();
                    if (this$heads == null) {
                        if (other$heads != null) {
                            return false;
                        }
                    } else if (!this$heads.equals(other$heads)) {
                        return false;
                    }
                    Object this$data = getData();
                    Object other$data = other.getData();
                    if (this$data == null) {
                        if (other$data != null) {
                            return false;
                        }
                    } else if (!this$data.equals(other$data)) {
                        return false;
                    }
                    Object this$checkResultDTOS = getCheckResultDTOS();
                    Object other$checkResultDTOS = other.getCheckResultDTOS();
                    if (this$checkResultDTOS == null) {
                        if (other$checkResultDTOS != null) {
                            return false;
                        }
                    } else if (!this$checkResultDTOS.equals(other$checkResultDTOS)) {
                        return false;
                    }
                    return Arrays.equals(getBytes(), other.getBytes());
                }
                return false;
            }
            return false;
        }
 
        protected boolean canEqual(final Object other) {
            return other instanceof ExcelDataDTO;
        }
 
        public int hashCode() {
            Object $heads = getHeads();
            int result = (1 * 59) + ($heads == null ? 43 : $heads.hashCode());
            Object $data = getData();
            int result2 = (result * 59) + ($data == null ? 43 : $data.hashCode());
            Object $checkResultDTOS = getCheckResultDTOS();
            return (((result2 * 59) + ($checkResultDTOS == null ? 43 : $checkResultDTOS.hashCode())) * 59) + Arrays.hashCode(getBytes());
        }
 
        public String toString() {
            return "ExcelUtils.ExcelDataDTO(heads=" + getHeads() + ", data=" + getData() + ", checkResultDTOS=" + getCheckResultDTOS() + ", bytes=" + Arrays.toString(getBytes()) + ")";
        }
 
        public List<String> getHeads() {
            return this.heads;
        }
 
        public List<Map<String, String>> getData() {
            return this.data;
        }
 
        public List<CheckResultDTO> getCheckResultDTOS() {
            return this.checkResultDTOS;
        }
 
        public byte[] getBytes() {
            return this.bytes;
        }
 
        public void addHead(String head) {
            this.heads.add(head);
        }
 
        private void addData(Integer index) {
            if (index.intValue() < this.data.size() && this.data.size() != 0) {
                return;
            }
            this.data.add(new HashMap());
            addData(index);
        }
 
        public void setData(Integer index, String head, String value) {
            addData(index);
            Map<String, String> map = this.data.get(this.data.size() - 1);
            map.put(head, value);
        }
    }
 
    public static ExcelExportDTO buildExcelExportDTO() {
        return new ExcelExportDTO();
    }
 
    public static ExcelTemplateDTO buildExcelTemplateDTO() {
        return new ExcelTemplateDTO();
    }
 
    public static ExcelDataDTO buildDataDTO() {
        return new ExcelDataDTO();
    }
}