Pu Zhibing
2025-04-22 d138293736414a314467a2641e6116ff263ead48
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
 
package com.ruoyi.bussiness.object.response.placement;
 
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.easyExcel.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
 
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
@Data
public class PlacementTemplateResponse {
 
    @ExcelProperty(value = "项目名称", index = 0, converter = StringConverter.class)
    @ApiModelProperty(value = "项目名称")
    private String projectName;
 
//    @DateTimeFormat(pattern = "yyyy/MM/dd")
    @ExcelProperty(value = "项目启动时间", index = 1, converter = DateConverter.class)
    @ApiModelProperty(value = "启动时间")
    private Date startTime;
 
    @ExcelProperty(value = "镇街", index = 2, converter = StringConverter.class)
    @ApiModelProperty(value = "街道")
    private String street;
 
    @ExcelProperty(value = "村社区", index = 3, converter = StringConverter.class)
    @ApiModelProperty(value = "社区")
    private String community;
 
    @ExcelProperty(value = "组", index = 4, converter = StringConverter.class)
    @ApiModelProperty(value = "组")
    private String groupName;
 
    @ExcelProperty(value = "户主姓名", index = 5, converter = StringConverter.class)
    @ApiModelProperty(value = "户主姓名")
    private String householdHead;
 
    @ExcelProperty(value = "身份证号码", index = 6, converter = StringConverter.class)
    @ApiModelProperty(value = "身份证号码")
    private String idCard;
 
    @ExcelProperty(value = "家庭成员名字", index = 7, converter = StringConverter.class)
    @ApiModelProperty(value = "家庭成员名称")
    private String familyName;
 
    @ExcelProperty(value = "关系", index = 8, converter = StringConverter.class)
    @ApiModelProperty(value = "关系")
    private String relation;
 
    @ExcelProperty(value = "人员性质", index = 9, converter = StringConverter.class)
    @ApiModelProperty(value = "人员类型")
    private String personType;
 
    @ExcelProperty(value = "身份证号码", index = 10, converter = StringConverter.class)
    @ApiModelProperty(value = "身份证号码")
    private String familyIdCard;
 
    @ExcelProperty(value = "年龄", index = 11, converter = NumberConverter.class)
    @ApiModelProperty(value = "年龄")
    private Integer age;
 
    @ExcelProperty(value = "性别", index = 12, converter = StringConverter.class)
    @ApiModelProperty(value = "性别")
    private String sex;
 
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy/MM/dd")
    @ExcelProperty(value = "出生年月日", index = 13, converter = DateConverter.class)
    private Date birthday;
 
    @ExcelProperty(value = "安置方式", index = 14, converter = StringConverter.class)
    @ApiModelProperty(value = "安置方式")
    private String ways;
 
    @DateTimeFormat(pattern = "yyyy/MM/dd")
    @ExcelProperty(value = "原始拆迁时领取过度费时间", index = 15, converter = DateConverter.class)
    @ApiModelProperty(value = "原始拆迁时领取过度费时间")
    private Date originCollectionTime;
 
    @DateTimeFormat(pattern = "yyyy/MM/dd")
    @ExcelProperty(value = "上次过度费发放时间(起)", index = 16, converter = DateConverter.class)
    @ApiModelProperty(value = "上次过度费发放时间(起)")
    private Date lastBeginTime;
 
    @DateTimeFormat(pattern = "yyyy/MM/dd")
    @ExcelProperty(value = "上次过度费发放时间(止)", index = 17, converter = DateConverter.class)
    @ApiModelProperty(value = "上次过度费发放时间(止)")
    private Date lastEndTime;
 
    @ExcelProperty(value = "剩余未安置面积(平方米)", index = 18, converter = BigDecimalConverter.class)
    @ApiModelProperty(value = "剩余未安置面积")
    private BigDecimal noHouseArea;
 
    @ExcelProperty(value = "剩余未安置商铺面积(平方米)", index = 19, converter = BigDecimalConverter.class)
    @ApiModelProperty(value = "剩余未安置商铺面积")
    private BigDecimal noShopArea;
 
    @ExcelProperty(value = "联系方式", index = 20, converter = StringConverter.class)
    @ApiModelProperty(value = "联系方式")
    private String mobile;
 
    @ExcelProperty(value = "备注", index = 21, converter = StringConverter.class)
    @ApiModelProperty(value = "备注")
    private String remark;
 
    public static PlacementTemplateResponse generateExampleData() {
        PlacementTemplateResponse exampleData = new PlacementTemplateResponse();
        exampleData.setProjectName("示例项目1");
        exampleData.setStartTime(new Date());
        exampleData.setStreet("示例街道1");
        exampleData.setCommunity("示例社区1");
        exampleData.setGroupName("示例组1");
        exampleData.setHouseholdHead("示例外户主1");
        exampleData.setFamilyName("示例外家庭成员1");
        exampleData.setFamilyIdCard("123456789012345678");
        exampleData.setRelation("示例外关系1");
        exampleData.setPersonType("示例外人员类型1");
        exampleData.setIdCard("123456789012345678");
        exampleData.setAge(30);
        exampleData.setSex("男");
        exampleData.setBirthday(new Date());
        exampleData.setWays("示例外安置方式1");
        exampleData.setOriginCollectionTime(new Date());
        exampleData.setMobile("13800138000");
        exampleData.setLastBeginTime(new Date());
        exampleData.setLastEndTime(new Date());
        exampleData.setNoHouseArea(new BigDecimal("100.50"));
        exampleData.setNoShopArea(new BigDecimal("50.25"));
        exampleData.setRemark("示例外备注1");
        return exampleData;
    }
 
    public static MultiDropdownWriteHandler generateHeaderData(List<SysDictData> street, List<SysDictData> relation) {
        Map<Integer, String[]> dropdownOptionsMap = new HashMap<>();
        dropdownOptionsMap.put(2, street.stream()
                .map(SysDictData::getDictLabel)
                .toArray(String[]::new));
        dropdownOptionsMap.put(8, relation.stream()
                .map(SysDictData::getDictLabel)
                .toArray(String[]::new));
        dropdownOptionsMap.put(12, new String[]{"男", "女"});
        return new MultiDropdownWriteHandler(dropdownOptionsMap);
    }
}