|
@@ -19,6 +19,7 @@ import com.huiju.estateagents.excel.handler.CustomCellWriteHandler;
|
19
|
19
|
import org.slf4j.Logger;
|
20
|
20
|
import org.slf4j.LoggerFactory;
|
21
|
21
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
22
|
+import org.springframework.format.annotation.DateTimeFormat;
|
22
|
23
|
import org.springframework.web.bind.annotation.PathVariable;
|
23
|
24
|
import org.springframework.web.bind.annotation.RequestBody;
|
24
|
25
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -30,6 +31,7 @@ import org.springframework.web.bind.annotation.RestController;
|
30
|
31
|
import javax.servlet.http.HttpServletRequest;
|
31
|
32
|
import javax.servlet.http.HttpServletResponse;
|
32
|
33
|
import java.io.IOException;
|
|
34
|
+import java.time.LocalDateTime;
|
33
|
35
|
import java.time.format.DateTimeFormatter;
|
34
|
36
|
import java.util.ArrayList;
|
35
|
37
|
import java.util.Arrays;
|
|
@@ -94,15 +96,15 @@ public class TaDrainageRecordController extends BaseController {
|
94
|
96
|
*/
|
95
|
97
|
@RequestMapping(value="/admin/taDrainageRecord/export",method= RequestMethod.GET)
|
96
|
98
|
public void taDrainageRecordList(@RequestParam(value = "drainageId") Integer drainageId,
|
97
|
|
- @RequestParam(value = "startTime",required = false) String startTime,
|
98
|
|
- @RequestParam(value = "endTime",required = false) String endTime,
|
|
99
|
+ @RequestParam(value = "startTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startTime,
|
|
100
|
+ @RequestParam(value = "endTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endTime,
|
99
|
101
|
HttpServletRequest request, HttpServletResponse response) throws IOException {
|
100
|
102
|
//使用分页插件
|
101
|
103
|
QueryWrapper<TaDrainageRecord> queryWrapper = new QueryWrapper<>();
|
102
|
104
|
queryWrapper.eq("drainage_id",drainageId);
|
103
|
105
|
queryWrapper.eq("org_id",getOrgId(request));
|
104
|
|
- queryWrapper.gt(!StringUtils.isEmpty(startTime),"create_date",startTime);
|
105
|
|
- queryWrapper.lt(!StringUtils.isEmpty(endTime),"create_date",endTime);
|
|
106
|
+ queryWrapper.gt(null != startTime,"create_date",startTime);
|
|
107
|
+ queryWrapper.lt(null != endTime,"create_date",endTime);
|
106
|
108
|
queryWrapper.orderByDesc("create_date");
|
107
|
109
|
|
108
|
110
|
List<TaDrainageRecord> list = iTaDrainageRecordService.list(queryWrapper);
|