Commit 71039e5a by 丁伟峰

LocalDate的日期格式

1 parent 4065761f
package com.dituhui.pea.order.dto; package com.dituhui.pea.order.dto;
import com.dituhui.pea.order.common.DateUtils;
import com.dituhui.pea.order.config.OrderConfig; import com.dituhui.pea.order.config.OrderConfig;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
...@@ -12,6 +13,8 @@ import java.time.LocalDate; ...@@ -12,6 +13,8 @@ import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import static com.dituhui.pea.order.config.OrderConfig.PATTERN_DATE;
public class OrderChangeListDTO { public class OrderChangeListDTO {
...@@ -27,11 +30,7 @@ public class OrderChangeListDTO { ...@@ -27,11 +30,7 @@ public class OrderChangeListDTO {
private String levelValue; private String levelValue;
private int page = OrderConfig.DEFAULT_PAGE_INDEX; private int page = OrderConfig.DEFAULT_PAGE_INDEX;
private int size = OrderConfig.DEFAULT_PAGE_SIZE; private int size = OrderConfig.DEFAULT_PAGE_SIZE;
private String date = DateUtils.formatDate(LocalDate.now(), PATTERN_DATE);
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
@JsonSerialize(using = LocalDateTimeSerializer.class)
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate date = LocalDate.now();
/** /**
* 排序 * 排序
*/ */
......
...@@ -50,12 +50,13 @@ public class WorkbenchServiceImpl implements WorkbenchService { ...@@ -50,12 +50,13 @@ public class WorkbenchServiceImpl implements WorkbenchService {
Page<?> changes; Page<?> changes;
String levelType = reqDTO.getLevelType(); String levelType = reqDTO.getLevelType();
String levelValue = reqDTO.getLevelValue(); String levelValue = reqDTO.getLevelValue();
LocalDate date = LocalDate.parse(reqDTO.getDate());
if ("cluster".equals(levelType)) { if ("cluster".equals(levelType)) {
changes = orderEventDao.findAllByClusterId(levelValue, reqDTO.getDate(), pageable); changes = orderEventDao.findAllByClusterId(levelValue, date, pageable);
} else if ("branch".equals(levelType)) { } else if ("branch".equals(levelType)) {
changes = orderEventDao.findAllByBranchId(levelValue, reqDTO.getDate(), pageable); changes = orderEventDao.findAllByBranchId(levelValue, date, pageable);
} else { } else {
changes = orderEventDao.findAllByGroupId(levelValue, reqDTO.getDate(), pageable); changes = orderEventDao.findAllByGroupId(levelValue, date, pageable);
} }
List<OrderChangeListDTO.Content> contents = new ArrayList<>(); List<OrderChangeListDTO.Content> contents = new ArrayList<>();
for (Object e1 : changes.getContent()) { for (Object e1 : changes.getContent()) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!