傅行帆 пре 3 година
родитељ
комит
2501bce75a

+ 1
- 1
src/main/java/com/yunzhi/marketing/excel/searchHouse/AddedValue.java Прегледај датотеку

@@ -68,6 +68,6 @@ public class AddedValue {
68 68
 
69 69
     @ColumnWidth(15)
70 70
     @ExcelProperty(value = "提交时间", index = 13)
71
-    private LocalDateTime createdTime;
71
+    private String createdTime;
72 72
 
73 73
 }

+ 3
- 1
src/main/java/com/yunzhi/marketing/excel/searchHouse/BuyRoom.java Прегледај датотеку

@@ -1,10 +1,12 @@
1 1
 package com.yunzhi.marketing.excel.searchHouse;
2 2
 
3 3
 import com.alibaba.excel.annotation.ExcelProperty;
4
+import com.alibaba.excel.annotation.format.DateTimeFormat;
4 5
 import com.alibaba.excel.annotation.write.style.ColumnWidth;
5 6
 import lombok.Data;
6 7
 
7 8
 import java.time.LocalDateTime;
9
+import java.util.Date;
8 10
 
9 11
 @Data
10 12
 public class BuyRoom {
@@ -77,6 +79,6 @@ public class BuyRoom {
77 79
 
78 80
     @ColumnWidth(15)
79 81
     @ExcelProperty(value = "提交时间", index = 15)
80
-    private LocalDateTime createdTime;
82
+    private String createdTime;
81 83
 
82 84
 }

+ 1
- 1
src/main/java/com/yunzhi/marketing/excel/searchHouse/Overseas.java Прегледај датотеку

@@ -43,6 +43,6 @@ public class Overseas {
43 43
 
44 44
     @ColumnWidth(15)
45 45
     @ExcelProperty(value = "提交时间", index = 7)
46
-    private LocalDateTime createdTime;
46
+    private String createdTime;
47 47
 
48 48
 }

+ 1
- 1
src/main/java/com/yunzhi/marketing/excel/searchHouse/Rent.java Прегледај датотеку

@@ -51,6 +51,6 @@ public class Rent {
51 51
 
52 52
     @ColumnWidth(15)
53 53
     @ExcelProperty(value = "提交时间", index = 9)
54
-    private LocalDateTime createdTime;
54
+    private String createdTime;
55 55
 
56 56
 }

+ 10
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/SearchHouseController.java Прегледај датотеку

@@ -40,6 +40,7 @@ import javax.servlet.http.HttpServletRequest;
40 40
 import javax.servlet.http.HttpServletResponse;
41 41
 import java.io.IOException;
42 42
 import java.time.LocalDateTime;
43
+import java.time.format.DateTimeFormatter;
43 44
 import java.util.ArrayList;
44 45
 import java.util.HashMap;
45 46
 import java.util.List;
@@ -134,6 +135,7 @@ public class SearchHouseController extends BaseController {
134 135
         searchHouse.setStatus(status);
135 136
         List<ExportSearchHouseVO> result = iSearchHouseService.selectExportHouseList(searchHouse);
136 137
 
138
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
137 139
         if (searchHouse.getType() == 4) {
138 140
             ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), AddedValue.class).registerWriteHandler(new CustomCellWriteHandler()).build();
139 141
             // 设置 sheet, 同一个sheet只需要设置一次
@@ -141,6 +143,8 @@ public class SearchHouseController extends BaseController {
141 143
             List<AddedValue> list = new ArrayList<>();
142 144
             result.forEach(e -> {
143 145
                 AddedValue addedValue = new AddedValue();
146
+                String format = formatter.format(e.getCreatedTime());
147
+                addedValue.setCreatedTime(format);
144 148
                 BeanUtils.copyProperties(e,addedValue);
145 149
                 list.add(addedValue);
146 150
             });
@@ -154,6 +158,8 @@ public class SearchHouseController extends BaseController {
154 158
             List<BuyRoom> list = new ArrayList<>();
155 159
             result.forEach(e -> {
156 160
                 BuyRoom buyRoom = new BuyRoom();
161
+                String format = formatter.format(e.getCreatedTime());
162
+                buyRoom.setCreatedTime(format);
157 163
                 BeanUtils.copyProperties(e,buyRoom);
158 164
                 list.add(buyRoom);
159 165
             });
@@ -167,6 +173,8 @@ public class SearchHouseController extends BaseController {
167 173
             List<Overseas> list = new ArrayList<>();
168 174
             result.forEach(e -> {
169 175
                 Overseas overseas = new Overseas();
176
+                String format = formatter.format(e.getCreatedTime());
177
+                overseas.setCreatedTime(format);
170 178
                 BeanUtils.copyProperties(e,overseas);
171 179
                 list.add(overseas);
172 180
             });
@@ -180,6 +188,8 @@ public class SearchHouseController extends BaseController {
180 188
             List<Rent> list = new ArrayList<>();
181 189
             result.forEach(e -> {
182 190
                 Rent rent = new Rent();
191
+                String format = formatter.format(e.getCreatedTime());
192
+                rent.setCreatedTime(format);
183 193
                 BeanUtils.copyProperties(e,rent);
184 194
                 list.add(rent);
185 195
             });