Commit aa4deb43 by 丁伟峰

LocalDate的日期格式强制转换。。。。。。奇怪,2023-07-14,默认也能转换成功的。居然会报错

1 parent 71039e5a
...@@ -2,6 +2,7 @@ package com.dituhui.pea.order.service.impl; ...@@ -2,6 +2,7 @@ package com.dituhui.pea.order.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dituhui.pea.common.Result; import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.DateUtils;
import com.dituhui.pea.order.dao.*; import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.OrderChangeListDTO; import com.dituhui.pea.order.dto.OrderChangeListDTO;
import com.dituhui.pea.order.dto.WorkbenchSummaryResp; import com.dituhui.pea.order.dto.WorkbenchSummaryResp;
...@@ -17,11 +18,14 @@ import org.springframework.data.domain.Pageable; ...@@ -17,11 +18,14 @@ import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.dituhui.pea.order.config.OrderConfig.PATTERN_DATE;
@Slf4j @Slf4j
@Service @Service
public class WorkbenchServiceImpl implements WorkbenchService { public class WorkbenchServiceImpl implements WorkbenchService {
...@@ -50,7 +54,7 @@ public class WorkbenchServiceImpl implements WorkbenchService { ...@@ -50,7 +54,7 @@ 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()); LocalDate date = LocalDate.parse(reqDTO.getDate(), DateTimeFormatter.ofPattern(PATTERN_DATE));
if ("cluster".equals(levelType)) { if ("cluster".equals(levelType)) {
changes = orderEventDao.findAllByClusterId(levelValue, date, pageable); changes = orderEventDao.findAllByClusterId(levelValue, date, pageable);
} else if ("branch".equals(levelType)) { } else if ("branch".equals(levelType)) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!