yanghb
2024-12-17 1287337fd0b0c156ec79712f9a600ebeffefe3a6
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
package com.zzg.system.domain.vo;
 
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.converters.doubleconverter.DoubleNumberConverter;
import com.alibaba.excel.converters.longconverter.LongNumberConverter;
import com.zzg.common.enums.HouseProductionTypeEnum;
import com.zzg.common.enums.HouseUsingTypeEnum;
import com.zzg.system.convert.easyExcel.MultiDropdownWriteHandler;
import com.zzg.system.convert.easyExcel.StringConverter;
import lombok.Data;
 
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
 
@Data
public class StateHouseholdExportVO {
 
    @ExcelIgnore
    private Integer houseUsingType;
    @ExcelIgnore
    private String houseUsingTypeStr;
    @ExcelProperty(value = "序号", index = 0, converter = StringConverter.class)
    private String index;
    @ExcelProperty(value = "所属镇/街", index = 1, converter = StringConverter.class)
    private String belongingStreetTown;
    @ExcelProperty(value = {"坐落", "街道"}, index = 2, converter = StringConverter.class)
    private String street;
 
    @ExcelProperty(value = {"坐落", "门牌"}, index = 3, converter = StringConverter.class)
    private String doorNumber;
 
    @ExcelProperty(value = {"坐落", "附号"}, index = 4, converter = StringConverter.class)
    private String apartmentNumber;
 
    @ExcelProperty(value = {"坐落", "栋号"}, index = 5, converter = StringConverter.class)
    private String buildingNumber;
 
    @ExcelProperty(value = {"坐落", "单元"}, index = 6, converter = StringConverter.class)
    private String unit;
 
    @ExcelProperty(value = {"坐落", "楼层"}, index = 7, converter = StringConverter.class)
    private String floor;
 
    @ExcelProperty(value = {"坐落", "房号"}, index = 8, converter = StringConverter.class)
    private String roomNumber;
 
    @ExcelProperty(value = "不动产权号", index = 9, converter = StringConverter.class)
    private String realEstateCertificateNumber;
 
    @ExcelProperty(value = "国有土地使用证号/房屋所有权证号", index = 10, converter = StringConverter.class)
    private String usingAreaCertificateNumber;
 
    @ExcelProperty(value = "权利人", index = 11, converter = StringConverter.class)
    private String ownerName;
 
    @ExcelProperty(value = "权利人数", index = 12, converter = LongNumberConverter.class)
    private Long personNum;
 
    @ExcelIgnore
    private Integer productionType;
 
    @ExcelProperty(value = "产别", index = 13, converter = StringConverter.class)
    private String productionTypeStr;
 
    @ExcelProperty(value = "建筑面积(平方米)", index = 14, converter = DoubleNumberConverter.class)
    private Double houseHoldArea;
 
    //是否同意搬迁
    @ExcelIgnore
    private Integer agreeMove;
 
    @ExcelProperty(value = "是否同意搬迁", index = 15, converter = StringConverter.class)
    private String agreeMoveStr;
 
    @ExcelProperty(value = "项目实施单位", index = 16, converter = StringConverter.class)
    private String department;
 
 
    public static StateHouseholdExportVO generateExampleData() {
        StateHouseholdExportVO exampleData = new StateHouseholdExportVO();
//        exampleData.setHouseUsingType(1); // 示例房屋用途类型
        exampleData.setHouseUsingTypeStr("商业"); // 示例房屋用途类型
        exampleData.setStreet("示例街道");
        exampleData.setDoorNumber("123号");
        exampleData.setApartmentNumber("A单元");
        exampleData.setBuildingNumber("B栋");
        exampleData.setUnit("单元1");
        exampleData.setFloor("5楼");
        exampleData.setRoomNumber("501房");
        exampleData.setRealEstateCertificateNumber("不动产权12345");
        exampleData.setUsingAreaCertificateNumber("使用证号98765");
        exampleData.setProductionTypeStr("公产"); // 私产
        exampleData.setHouseHoldArea(120.5); // 建筑面积
        exampleData.setBelongingStreetTown("示例所属单位"); // 建筑面积
//        exampleData.setAgreeMoveStr("同意搬迁"); // 是否同意搬迁,1: 同意
//        exampleData.setDepartment("项目实施单位示例");
//        exampleData.setOwnerName("");
//        exampleData.setPersonNum(0L);
        return exampleData;
    }
 
    public static MultiDropdownWriteHandler generateHeaderData() {
        Map<Integer, String[]> dropdownOptionsMap = new HashMap<>();
        dropdownOptionsMap.put(0, Arrays.stream(HouseUsingTypeEnum.values())
                .map(HouseUsingTypeEnum::getText)
                .toArray(String[]::new));
        dropdownOptionsMap.put(10,   Arrays.stream(HouseProductionTypeEnum.values())
                .map(HouseProductionTypeEnum::getText)
                .toArray(String[]::new));
        return new MultiDropdownWriteHandler(dropdownOptionsMap);
    }
 
}